{"trustable":false,"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":"在一个有向无环图上有n个顶点,每一个顶点都只有一个棋子,有两个人,每次根据这个图只能将任意一颗棋子移动一步\n\n,如果到某一步玩家不能移动时,那么这个人就输."}},{"title":"Input","value":{"format":"HTML","content":"Input contains multiple test cases. Each test case starts with a number N (1 \u0026lt;\u003d N \u0026lt;\u003d 1000) in one line. Then the following N lines describe the out-positions of each position. Each line starts with an integer Xi that is the number of out-positions for the position i. Then Xi integers following specify the out-positions. Positions are indexed from 0 to N-1. Then multiple queries follow. Each query occupies only one line. The line starts with a number M (1 \u0026lt;\u003d M \u0026lt;\u003d 10), and then come M integers, which are the initial positions of chesses. A line with number 0 ends the test case. \n棋子可以重合, 就是如果v有一个棋子,u的棋子可以走到v\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"There is one line for each query, which contains a string \"WIN\" or \"LOSE\". \"WIN\" means that the player taking the first turn can win the game according to a clever strategy; otherwise \"LOSE\" should be printed. \n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e4\n2 1 2\n0\n1 3\n0\n1 0\n2 0 2\n0\n\n4\n1 1\n1 2\n0\n0\n2 0 1\n2 1 1\n3 0 1 3\n0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eWIN\nWIN\nWIN\nLOSE\nWIN\u003c/pre\u003e"}}]}