{"trustable":true,"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\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" height\u003d\"265px\" src\u003d\"CDN_BASE_URL/4c6cacbcf9b8efbdedd296fb990292f3?v\u003d1715836028\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\" width\u003d\"265px\"\u003e \u003c/center\u003e Lily is fascinated by numbers. She believes the whole world revolves around them, and that everything is connected by numbers. Her friends, Alice, Bob, Charlie and Diane, are not convinced. But she gives them an example:\u003cp\u003e \"Alice lives in house number 25 on her street, but that is exactly Bob\u0027s age. Bob is born on June 4th, and Charlie was his parents\u0027 fourth child. Finally, Diane has five fingers on her left hand, which happens to be the same as the number of toes that Bob has on his right foot!\"\u003c/p\u003e\u003cp\u003eThis shows that her friends are all connected—either directly or indirectly—by numbers. But she still has to convince her family as well as her coworkers.\u003c/p\u003e\u003cp\u003eGiven a group of $$$n$$$ individuals, and a set of numbers that describe each individual, help Lily come up with a proof that shows that everyone in this group is either directly or indirectly connected by numbers, or determine that this is not possible.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input consists of: \u003c/p\u003e\u003cul\u003e \u003cli\u003e One line with an integer $$$n$$$ ($$$2 \\leq n \\leq 2\\cdot 10^5$$$), the number of individuals in the group. The individuals are numbered from $$$1$$$ to $$$n$$$. \u003c/li\u003e\u003cli\u003e $$$n$$$ lines, describing the individuals in the group.\u003cp\u003e The $$$i$$$th such line starts with an integer $$$m_i$$$ ($$$1 \\leq m_i \\leq 2\\cdot 10^5$$$), the number of numbers that describe individual $$$i$$$.\u003c/p\u003e\u003cp\u003e The remainder of the line has $$$m_i$$$ distinct integers $$$d_{i,1},\\ldots,d_{i,m_i}$$$ ($$$1 \\leq d_{i,j} \\leq 10^9$$$ for each $$$j$$$), the set of numbers that describe individual $$$i$$$. \u003c/p\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eIt is guaranteed that the sum over all $$$m_i$$$ is at most $$$2\\cdot 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput a proof in the form of $$$n-1$$$ lines, each of which contains three integers $$$p$$$, $$$q$$$ and $$$r$$$, where $$$p$$$ and $$$q$$$ are distinct individuals that are both described by the number $$$r$$$. Using only these relations, it must be possible to show that any pair of individuals in the group are connected either directly or indirectly.\u003c/p\u003e\u003cp\u003eIf no such proof exists, output \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eimpossible\u003c/span\u003e\". If there are multiple proofs, you may output any one of them.\u003c/p\u003e"}},{"title":"Examples","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\u003e6\n2 17 10\n1 5\n2 10 22\n3 17 22 9\n2 17 8\n3 9 22 16\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eimpossible\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e6\n2 17 10\n2 5 10\n2 10 22\n3 17 22 9\n2 17 8\n3 9 22 16\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 4 17\n4 3 22\n3 2 10\n4 6 22\n1 5 17\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}