{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003e\u003ci\u003eN\u003c/i\u003e children are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible that some group is empty). You don’t know who is the judge, or how the children are grouped. Then the children start playing Rochambeau game for \u003ci\u003eM\u003c/i\u003e rounds. Each round two children are arbitrarily selected to play Rochambeau for one once, and you will be told the outcome while not knowing which gesture the children presented. It is known that the children in the same group would present the same gesture (hence, two children in the same group always get draw when playing) and different groups for different gestures. The judge would present gesture randomly each time, hence no one knows what gesture the judge would present. Can you guess who is the judge after after the game ends? If you can, after how many rounds can you find out the judge at the earliest?\u003c/p\u003e\u003c/span\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eInput contains multiple test cases. Each test case starts with two integers \u003ci\u003eN\u003c/i\u003e and \u003ci\u003eM\u003c/i\u003e (1 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 500, 0 ≤ \u003ci\u003eM\u003c/i\u003e ≤ 2,000) in one line, which are the number of children and the number of rounds. Following are \u003ci\u003eM\u003c/i\u003e lines, each line contains two integers in [0, \u003ci\u003eN\u003c/i\u003e) separated by one symbol. The two integers are the IDs of the two children selected to play Rochambeau for this round. The symbol may be “\u003d”, “\u0026gt;” or “\u0026lt;”, referring to a draw, that first child wins and that second child wins respectively.\u003c/p\u003e\u003c/span\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eThere is only one line for each test case. If the judge can be found, print the ID of the judge, and the least number of rounds after which the judge can be uniquely determined. If the judge can not be found, or the outcomes of the \u003ci\u003eM\u003c/i\u003e rounds of game are inconsistent, print the corresponding message.\u003c/p\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\u003e3 3\r\n0\u0026amp;lt;1\r\n1\u0026amp;lt;2\r\n2\u0026amp;lt;0\r\n3 5\r\n0\u0026amp;lt;1\r\n0\u0026amp;gt;1\r\n1\u0026amp;lt;2\r\n1\u0026amp;gt;2\r\n0\u0026amp;lt;2\r\n4 4\r\n0\u0026amp;lt;1\r\n0\u0026amp;gt;1\r\n2\u0026amp;lt;3\r\n2\u0026amp;gt;3\r\n1 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCan not determine\r\nPlayer 1 can be determined to be the judge after 4 lines\r\nImpossible\r\nPlayer 0 can be determined to be the judge after 0 lines\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}