{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \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?\n题目大意:n个小伙伴进行猜拳有戏,除了一个比较聪明的家伙以外,其他人只会出单一的一种,给出m中猜拳的结果,要求找出那个比较聪明的小伙伴序号,并且输出在第几次猜拳可以确定。(注意\u003c,\u003e,\u003d前后可能有空格)\n\u003c/p\u003e\u003c/span\u003e\n \u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \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\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n \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\n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3 3\n0\u0026lt;1\n1\u0026lt;2\n2\u0026lt;0\n3 5\n0\u0026lt;1\n0\u0026gt;1\n1\u0026lt;2\n1\u0026gt;2\n0\u0026lt;2\n4 4\n0\u0026lt;1\n0\u0026gt;1\n2\u0026lt;3\n2\u0026gt;3\n1 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003eCan not determine\nPlayer 1 can be determined to be the judge after 4 lines\nImpossible\nPlayer 0 can be determined to be the judge after 0 lines\u003c/pre\u003e"}}]}