{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003ePetr, a student, wants to make money with SMS-spam. Of course he wants to spend as little money as possible for sending a message and send messages as quick as he can. Petr decided to buy a new Dual-SIM mobile phone, which can work with SIM-cards of two different mobile operators simultaneously. Now Petr can send a message to a certain phone number via one of two chosen operators which requests less money for that.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eUnfortunately, not all mobile operators allow sending messages to numbers of all other operators via them. Help Petr choose a pair of operators in such a way that he would be able to send messages to numbers of all operators and the maximum cost of sending a message would be minimal possible.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first line contains integers \u003ci\u003en\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e\r\n(2 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup\u003e4\u003c/sup\u003e; 0 ≤ \u003ci\u003ek\u003c/i\u003e ≤ 10\u003csup\u003e5\u003c/sup\u003e).\r\n\u003ci\u003en\u003c/i\u003e is equal to the total number of mobile operators.\r\nEach of the following \u003ci\u003ek\u003c/i\u003e lines contains integers \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e\r\nand \u003ci\u003ec\u003c/i\u003e (1 ≤ \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e ≤ \u003ci\u003en\u003c/i\u003e; 1 ≤ \u003ci\u003ec\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e), which means\r\nthat Petr can send an SMS via operator \u003ci\u003ex\u003c/i\u003e to a phone number of operator \u003ci\u003ey\u003c/i\u003e for cost \u003ci\u003ec\u003c/i\u003e.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOutput the maximal cost of sending an SMS, which can be achieved by choosing an optimal pair of operators, or “No solution” if it is impossible to choose a required pair of operators.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4 13\r\n1 1 1\r\n1 2 3\r\n1 3 3\r\n1 4 5\r\n2 1 2\r\n2 2 1\r\n2 3 2\r\n3 1 4\r\n3 3 4\r\n3 4 1\r\n4 1 2\r\n4 2 3\r\n4 4 3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2\r\n1 1 3\r\n2 1 4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo solution\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}