{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"The degree of a vertex in a graph is the number of edges adjacent to the vertex. A graph is 3-regular if all of its vertices have degree 3. Given an integer n, you are to build a simple undirected 3-regular graph with n vertices. If there are multiple solutions, any one will do.\n"}},{"title":"Input","value":{"format":"PLAIN","content":"For each test case, the input will be a single integer n as described above. End of input will be denoted by a case where n \u003d 0. This case should not be processed.\n"}},{"title":"Output","value":{"format":"PLAIN","content":"If it is possible to build a simple undirected 3-regular graph with n vertices, print a line with an integer e which is the number of edges in your graph. Each of the following e lines describes an edge of the graph. An edge description contains two integers a and b, the two endpoints of the edge. Note that the vertices are indexed from 1 to n. If it is not possible to build a simple undirected 3-regular graph with n vertices, print \u0027Impossible\u0027 in a single line.\n\n1 \u003c\u003d n \u003c\u003d 100"}},{"title":"Sample Input","value":{"format":"PLAIN","content":"4\n3\n0\n"}},{"title":"Sample Output","value":{"format":"PLAIN","content":"6\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\nImpossible"}}]}