{"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\"\u003eGiven a series of rectangular obstacles, one per line. Rectangular obstacles can overlap each other. Each rectangular obstacle is specified as two points on 2D plane that specify the opposite corners of a rectangle. Your job is to calculate the outline of the coverage area of all rectangular.\u003cbr\u003e\u003cbr\u003eIf the outline is made up of more than one closed polyline, print \"Oops!\". Otherwise, output the answer as follows: The first output point has the smallest X coordinate and then smallest Y coordinate. The second point has the same X coordinate with the first point. Then output other points in outline order. You can see more details in Sample.\u003cbr\u003e\u003cbr\u003eIt\u0027s guarantee that every rectangle\u0027s sides are parallel to OX and OY. Any point on the 2D plane will not be the vertices of two rectangles at the same time. \u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contain a integer $T$(no more than 10), the following is $T$ test case, for each test case:\u003cbr\u003e\u003cbr\u003eThe first line of each test case contains a integers n (1 $\\le$ n $\\le$ 100,000), number of rectangular obstacles. \u003cbr\u003e\u003cbr\u003eEach of the next n lines contains 4 integers x1, y1, x2, y2 (1 $\\le$ x1 \u0026lt; x2 $\\le$ 1,000,000,000, 1 $\\le$ y1 \u0026lt; y2 $\\le$ 1,000,000,000) specify a rectangular obstacles. \u003cbr\u003e\u003cbr\u003eIt is guaranteed that the sum of all n does not exceed 700,000.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Output the answer as described previously.\u003cbr\u003e"}},{"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 3 3\r\n2 2 4 4\r\n4\r\n1 2 2 5\r\n3 2 4 5\r\n2 1 3 3\r\n2 4 3 6\r\n2\r\n1 1 2 2\r\n3 3 4 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8\r\n1 1\r\n1 3\r\n2 3\r\n2 4\r\n4 4\r\n4 2\r\n3 2\r\n3 1\r\nOops!\r\nOops!\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}