{"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":"\u003cp\u003eYou are given a graph with $$$3 \\cdot n$$$ vertices and $$$m$$$ edges. You are to find a matching of $$$n$$$ edges, \u003cspan class\u003d\"tex-font-style-bf\"\u003eor\u003c/span\u003e an independent set of $$$n$$$ vertices.\u003c/p\u003e\u003cp\u003eA set of edges is called a matching if no two edges share an endpoint.\u003c/p\u003e\u003cp\u003eA set of vertices is called an independent set if no two vertices are connected with an edge.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$T \\ge 1$$$\u0026nbsp;— the number of graphs you need to process. The description of $$$T$$$ graphs follows.\u003c/p\u003e\u003cp\u003eThe first line of description of a single graph contains two integers $$$n$$$ and $$$m$$$, where $$$3 \\cdot n$$$ is the number of vertices, and $$$m$$$ is the number of edges in the graph ($$$1 \\leq n \\leq 10^{5}$$$, $$$0 \\leq m \\leq 5 \\cdot 10^{5}$$$).\u003c/p\u003e\u003cp\u003eEach of the next $$$m$$$ lines contains two integers $$$v_i$$$ and $$$u_i$$$ ($$$1 \\leq v_i, u_i \\leq 3 \\cdot n$$$), meaning that there is an edge between vertices $$$v_i$$$ and $$$u_i$$$.\u003c/p\u003e\u003cp\u003eIt is guaranteed that there are no self-loops and no multiple edges in the graph.\u003c/p\u003e\u003cp\u003eIt is guaranteed that the sum of all $$$n$$$ over all graphs in a single test does not exceed $$$10^{5}$$$, and the sum of all $$$m$$$ over all graphs in a single test does not exceed $$$5 \\cdot 10^{5}$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint your answer for each of the $$$T$$$ graphs. Output your answer for a single graph in the following format.\u003c/p\u003e\u003cp\u003eIf you found a matching of size $$$n$$$, on the first line print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eMatching\u003c/span\u003e\" (without quotes), and on the second line print $$$n$$$ integers\u0026nbsp;— the indices of the edges in the matching. The edges are numbered from $$$1$$$ to $$$m$$$ in the input order.\u003c/p\u003e\u003cp\u003eIf you found an independent set of size $$$n$$$, on the first line print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eIndSet\u003c/span\u003e\" (without quotes), and on the second line print $$$n$$$ integers\u0026nbsp;— the indices of the vertices in the independent set.\u003c/p\u003e\u003cp\u003eIf there is no matching and no independent set of the specified size, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eImpossible\u003c/span\u003e\" (without quotes).\u003c/p\u003e\u003cp\u003eYou can print edges and vertices in any order.\u003c/p\u003e\u003cp\u003eIf there are several solutions, print any. In particular, if there are both a matching of size $$$n$$$, and an independent set of size $$$n$$$, then you should print exactly one of such matchings \u003cspan class\u003d\"tex-font-style-bf\"\u003eor\u003c/span\u003e exactly one of such independent sets.\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\u003e4\n1 2\n1 3\n1 2\n1 2\n1 3\n1 2\n2 5\n1 2\n3 1\n1 4\n5 1\n1 6\n2 15\n1 2\n1 3\n1 4\n1 5\n1 6\n2 3\n2 4\n2 5\n2 6\n3 4\n3 5\n3 6\n4 5\n4 6\n5 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eMatching\n2\nIndSet\n1\nIndSet\n2 4\nMatching\n1 15\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\u003eThe first two graphs are same, and there are both a matching of size 1 and an independent set of size 1. Any of these matchings and independent sets is a correct answer.\u003c/p\u003e\u003cp\u003eThe third graph does not have a matching of size 2, however, there is an independent set of size 2. Moreover, there is an independent set of size 5: \u003cspan class\u003d\"tex-font-style-tt\"\u003e2 3 4 5 6\u003c/span\u003e. However such answer is not correct, because you are asked to find an independent set (or matching) of size \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly\u003c/span\u003e $$$n$$$.\u003c/p\u003e\u003cp\u003eThe fourth graph does not have an independent set of size 2, but there is a matching of size 2.\u003c/p\u003e"}}]}