{"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\"\u003eAfter returning with honour from ICPC(International Cat Programming Contest) World Finals, Tom decides to say goodbye to ICPC and start a new period of life. He quickly gets interested in AI.\u003cbr\u003e\u003cbr\u003eIn the subject of Machine Learning, there is a classical classification model called perceptron, defined as follows:\u003cbr\u003e\u003cbr\u003e\u003cbr\u003eAssuming we get a set of training samples: $D \u003d \\{(\\boldsymbol{x_1},y_1), (\\boldsymbol{x_2},y_2), ...,(\\boldsymbol{x_N},y_N)\\}$, with their inputs $\\boldsymbol{x}\\in \\mathbb{R}^d$, and outputs $y\\in \\{-1, 1\\}$. We will try to find a function \u003cbr\u003e $f(\\boldsymbol{x})\u003d{\\rm sign}(\\sum_{i\u003d1}^dw_i\\cdot x_i+b)\u003d{\\rm sign}(\\boldsymbol{w^T\\cdot x}+b)$ so that $f(\\boldsymbol{x_i}) \u003d y_i,i \u003d 1,2,...,N$.\u003cbr\u003e\u003cbr\u003e$\\boldsymbol{w},\\boldsymbol{x}$ mentioned above are all $d$-dimensional vectors, i.e. $\\boldsymbol{w}\u003d(w_1,w_2,...,w_d)$, $\\boldsymbol{x}\u003d(x_1,x_2,...,x_d)$. To simplify the question, let $w_0\u003db$, $x_0\u003d1$, then $f(\\boldsymbol{x})\u003d{\\rm sign}(\\sum_{i\u003d0}^dw_i\\cdot x_i)\u003d{\\rm sign}(\\boldsymbol{w^T\\cdot x})$. Therefore, finding a satisfying function $f(\\boldsymbol{x})$ is equivalent to finding a proper $\\boldsymbol{w}$.\u003cbr\u003e\u003cbr\u003eTo solve the problem, we have a algorithm, \u003ci\u003ePLA(Popcorn Label Algorithm)\u003c/i\u003e.\u003cbr\u003e\u003cbr\u003eAccoding to \u003ci\u003ePLA\u003c/i\u003e, we will randomly generate $\\boldsymbol{w}$.\u003cbr\u003e\u003cbr\u003eIf $f(\\boldsymbol{x})\u003d{\\rm sign}(\\boldsymbol{w^T\\cdot x})$ fails to give \u003cbr\u003e any element $(\\boldsymbol{x_i},y_i)\\in D$ the right classification, i.e. $f(\\boldsymbol{x_i})\\neq y_i$, then we will replace $\\boldsymbol{w}$ with another random vector. We will do this repeatedly until all the samples $\\in D$ are correctly classified.\u003cbr\u003e\u003cbr\u003eAs a former-JBer, Tom excels in programming and quickly wrote the pseudocode of \u003ci\u003ePLA\u003c/i\u003e.\u003cbr\u003e\u003cbr\u003e\u003cpre\u003e\u003cbr\u003ew :\u003d a random vector\u003cbr\u003ewhile true do\u003cbr\u003e flag:\u003dtrue\u003cbr\u003e for i:\u003d1 to N do\u003cbr\u003e if f(x[ i ]) !\u003d y[ i ] then\u003cbr\u003e flag:\u003dfalse\u003cbr\u003e break\u003cbr\u003e if flag then\u003cbr\u003e break\u003cbr\u003e else\u003cbr\u003e w :\u003d a random vector\u003cbr\u003ereturn w\u003cbr\u003e\u003c/pre\u003e\u003cbr\u003e\u003cbr\u003eBut Tom found that, in some occasions, \u003ci\u003ePLA\u003c/i\u003e will end up into an infinite loop, which confuses him a lot. You are required to help Tom determine, when performed on a given sample set $D$, if \u003ci\u003ePLA\u003c/i\u003e will end up into an infinite loop. Print \u003ci\u003eInfinite loop!\u003c/i\u003e if so, or \u003ci\u003eSuccessful!\u003c/i\u003e otherwise.\u003cbr\u003e\u003cbr\u003eWe only consider cases when $d\u003d2$ for simplification.\u003cbr\u003eNote: $\u003cbr\u003e{\\rm sign}(x) \u003d \\begin{cases}\u003cbr\u003e -1 \u0026amp; x \u0026lt; 0 \\\\\u003cbr\u003e 0 \\ \u0026amp; x \u003d 0 \\\\\u003cbr\u003e 1 \\ \u0026amp; x \u0026gt; 0\u003cbr\u003e\\end{cases}\u003cbr\u003e$\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer $T(1\\leq T\\leq 1000)$, the number of test cases.\u003cbr\u003eEach test case begins with a line containing a single integer $n(1\\leq n\\leq 100)$, size of the set of training samples $D$.\u003cbr\u003eThen $n$ lines follow, the $i$th of which contains three integers $x_{i,1},x_{i,2},y_i$ $(-10^5\\leq x_{i,1},x_{i,2}\\leq 10^5,$ $y_i\\in\\{-1,1\\})$, indicating the $i$th sample $(\\boldsymbol{x_i},y_i)$ in $D$, where $\\boldsymbol{x_i}\u003d(x_{i,1},x_{i,2})$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output a single line containing the answer: “Infinite loop!” or “Successful!”."}},{"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\u003e3\r\n2\r\n1 1 1\r\n2 0 -1\r\n4\r\n0 0 1\r\n2 0 -1\r\n1 1 1\r\n1 -1 -1\r\n6\r\n0 0 1\r\n2 0 -1\r\n1 1 1\r\n1 -1 -1\r\n1 0 1\r\n0 1 -1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eSuccessful!\r\nSuccessful!\r\nInfinite loop!\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}