{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\u003cb\u003eN.B - No graph/tree algorithm such as bfs, dfs, adjacency list isn\u0027t necessary to solve this problem. Give it a try. \u003c/b\u003e\n\u003c/p\u003e\n\n \n\n\u003cp\u003eAyush and Ashish play a game on an unrooted tree consisting of $$$n$$$ nodes numbered $$$1$$$ to $$$n$$$. Players make the following move in turns:\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003eSelect any leaf node in the tree and remove it together with any edge which has this node as one of its endpoints. A leaf node is a node with degree less than or equal to $$$1$$$.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eA tree is a connected undirected graph without cycles.\u003c/p\u003e\n\u003cp\u003eThere is a special node numbered $$$x$$$. The player who removes this node wins the game.\u003c/p\u003e\n\u003cp\u003eAyush moves first. Determine the winner of the game if each player plays optimally.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains a single integer $$$t$$$ $$$(1 \\leq t \\leq 10)$$$\u0026nbsp;— the number of testcases. The description of the test cases follows.\u003c/p\u003e\n\u003cp\u003eThe first line of each testcase contains two integers $$$n$$$ and $$$x$$$ $$$(1\\leq n \\leq 1000, 1 \\leq x \\leq n)$$$\u0026nbsp;— the number of nodes in the tree and the special node respectively.\u003c/p\u003e\n\u003cp\u003eEach of the next $$$n-1$$$ lines contain two integers $$$u$$$, $$$v$$$ $$$(1 \\leq u, v \\leq n, \\text{ } u \\ne v)$$$, meaning that there is an edge between nodes $$$u$$$ and $$$v$$$ in the tree.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor every test case, if Ayush wins the game, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eAyush\u003c/span\u003e\", otherwise print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eAshish\u003c/span\u003e\" (without quotes).\u003c/p\u003e"}},{"title":"Sample 1","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\u003e1\n3 1\n2 1\n3 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eAshish\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","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\u003e1\n3 2\n1 2\n1 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eAyush\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eFor the $$$1$$$st test case, Ayush can only remove node $$$2$$$ or $$$3$$$, after which node $$$1$$$ becomes a leaf node and Ashish can remove it in his turn.\u003c/p\u003e\n\u003cp\u003eFor the $$$2$$$nd test case, Ayush can remove node $$$2$$$ in the first move itself.\u003c/p\u003e"}}]}