{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eKids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk. \u003cbr\u003eSo the teacher came up with an idea: Vote. Every child have some nice handkerchiefs, and if he/she think someone is suitable for the role of Hawk, he/she gives a handkerchief to this kid, which means this kid who is given the handkerchief win the support. Note the support can be transmitted. Kids who get the most supports win in the vote and able to play the role of Hawk.(A note:if A can win\u003cbr\u003esupport from B(A !\u003d B) A can win only one support from B in any case the number of the supports transmitted from B to A are many. And A can\u0027t win the support from himself in any case.\u003cbr\u003eIf two or more kids own the same number of support from others, we treat all of them as winner.\u003cbr\u003eHere\u0027s a sample: 3 kids A, B and C, A gives a handkerchief to B, B gives a handkerchief to C, so C wins 2 supports and he is choosen to be the Hawk.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are several test cases. First is a integer T(T \u0026lt;\u003d 50), means the number of test cases.\u003cbr\u003eEach test case start with two integer n, m in a line (2 \u0026lt;\u003d n \u0026lt;\u003d 5000, 0 \u0026lt;m \u0026lt;\u003d 30000). n means there are n children(numbered from 0 to n - 1). Each of the following m lines contains two integers A and B(A !\u003d B) denoting that the child numbered A give a handkerchief to B."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, the output should first contain one line with \"Case x:\", here x means the case number start from 1. Followed by one number which is the total \u003cfont color\u003d\"red\"\u003esupports\u003c/font\u003e the winner(s) get. \u003cbr\u003eThen follow a line contain all the Hawks\u0027 number. The numbers must be listed in increasing order and separated by single spaces. "}},{"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\u003e2\r\n4 3\r\n3 2\r\n2 0\r\n2 1\r\n\r\n3 3\r\n1 0\r\n2 1\r\n0 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 2\r\n0 1\r\nCase 2: 2\r\n0 1 2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}