{"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\"\u003eThere are \u003ci\u003en\u003c/i\u003e boxes \u003ci\u003eC\u003csub\u003e1\u003c/sub\u003e, C\u003csub\u003e2\u003c/sub\u003e, ..., C\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e in 3D space. The edges of the boxes are parallel to the \u003ci\u003ex, y\u003c/i\u003e or \u003ci\u003ez\u003c/i\u003e-axis. We provide some relations of the boxes, and your task is to construct a set of boxes satisfying all these relations.\u003cbr\u003e\u003cbr\u003eThere are four kinds of relations (1 \u0026lt;\u003d \u003ci\u003ei,j\u003c/i\u003e \u0026lt;\u003d \u003ci\u003en\u003c/i\u003e, \u003ci\u003ei\u003c/i\u003e is different from \u003ci\u003ej\u003c/i\u003e):\u003cbr\u003e\u003cul\u003e\u003cli\u003eI i j: The intersection volume of \u003ci\u003eC\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003eC\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e is positive.\u003c/li\u003e\u003cbr\u003e\u003cli\u003eX i j: The intersection volume is zero, and any point inside \u003ci\u003eC\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e has smaller \u003ci\u003ex\u003c/i\u003e-coordinate than any point inside \u003ci\u003eC\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e.\u003c/li\u003e\u003cbr\u003e\u003cli\u003eY i j: The intersection volume is zero, and any point inside \u003ci\u003eC\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e has smaller \u003ci\u003ey\u003c/i\u003e-coordinate than any point inside \u003ci\u003eC\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e.\u003c/li\u003e\u003cbr\u003e\u003cli\u003eZ i j: The intersection volume is zero, and any point inside \u003ci\u003eC\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e has smaller \u003ci\u003ez\u003c/i\u003e-coordinate than any point inside \u003ci\u003eC\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e.\u003c/li\u003e\u003c/ul\u003e.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There will be at most 30 test cases. Each case begins with a line containing two integers \u003ci\u003en\u003c/i\u003e (1 \u0026lt;\u003d \u003ci\u003en\u003c/i\u003e \u0026lt;\u003d 1,000) and \u003ci\u003eR\u003c/i\u003e (0 \u0026lt;\u003d \u003ci\u003eR\u003c/i\u003e \u0026lt;\u003d 100,000), the number of boxes and the number of relations. Each of the following \u003ci\u003eR\u003c/i\u003e lines describes a relation, written in the format above. The last test case is followed by \u003ci\u003en\u003c/i\u003e\u003d\u003ci\u003eR\u003c/i\u003e\u003d0, which should not be processed."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print the case number and either the word POSSIBLE or IMPOSSIBLE. If it\u0027s possible to construct the set of boxes, the \u003ci\u003ei\u003c/i\u003e-th line of the following \u003ci\u003en\u003c/i\u003e lines contains six integers \u003ci\u003ex1, y1, z1, x2, y2, z2,\u003c/i\u003e that means the \u003ci\u003ei\u003c/i\u003e-th box is the set of points (\u003ci\u003ex,y,z\u003c/i\u003e) satisfying \u003ci\u003ex1 \u0026lt;\u003d x \u0026lt;\u003d x2, y1 \u0026lt;\u003d y \u0026lt;\u003d y2, z1 \u0026lt;\u003d z \u0026lt;\u003d z2\u003c/i\u003e. The absolute values of \u003ci\u003ex1, y1, z1, x2, y2, z2\u003c/i\u003e should not exceed 1,000,000.\u003cbr\u003e\u003cbr\u003ePrint a blank line after the output of each test case."}},{"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 2\r\nI 1 2\r\nX 2 3\r\n3 3\r\nZ 1 2\r\nZ 2 3\r\nZ 3 1\r\n1 0\r\n0 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: POSSIBLE\r\n0 0 0 2 2 2\r\n1 1 1 3 3 3\r\n8 8 8 9 9 9\r\n\r\nCase 2: IMPOSSIBLE\r\n\r\nCase 3: POSSIBLE\r\n0 0 0 1 1 1\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}