{"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":"MD","content":"给定一个$n$个点的有向无环图,节点从$0$到$n-1$编号。\n游戏由若干轮组成,对于每一轮。\n一开始,有$k$个棋子在图上的一些节点上。Alice和Bob会轮流选择一个棋子,Alice先操作,将它沿着一条出边移动。如果无法移动,则当前操作的人输。\n假设双方都绝顶聪明,问Alice是输还是赢。"}},{"title":"Input","value":{"format":"MD","content":"**此题有多组数据** \n对于每组数据,第一行一个整数 $n (1 \\leq n \\leq 1000)$,表示节点个数。 \n\n接下来 $n$ 行,每行第一个整数是 $m$,表示第 $i (0 \\leq i \\leq n-1)$ 个节点有 $m$ 条出边。接着 $m$ 个整数 $j (i+1 \\leq j \\leq n-1)$,表示节点 $i$ 有一条出边指向$j$。保证图中没有重边。\n\n接下来若干行表示每轮游戏,每行第一个整数 $k (1 \\leq k \\leq 10)$,表示 $k$ 个棋子。接下来 $k$ 个整数$x_i (0 \\leq x_i \\leq n-1)$,表示$i$ 号棋子在$x_i$号节点上。当 $k$ 为 $0$ 时游戏结束。保证游戏轮数不超过 $1000$。"}},{"title":"Output","value":{"format":"MD","content":"对于每组数据,如果Alice获胜输出\"WIN\",否则输出\"LOST\"。"}},{"title":"Sample","value":{"format":"MD","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\u003e\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\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003eWIN\nWIN\nWIN\nLOSE\nWIN\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}