Codeforces and Polygon may be unavailable from May 23, 4:00 (UTC) to May 23, 8:00 (UTC) due to technical maintenance. ×

G. Greedy Drawers
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Janko has $$$N$$$ rectangular notebooks on the table. The $$$i$$$-th notebook has sides of length $$$A_i$$$ and $$$B_i$$$. Next to the table is a chest of drawers that consists of $$$N$$$ drawers, which have a rectangular shape but can be of different sizes. The $$$j$$$-th drawers has width $$$X_j$$$ and depth $$$Y_j$$$. Janko wants to store each notebook in its own drawer. He can rotate the notebooks but will place them in a drawer so that the sides of the notebook are aligned with the sides of the drawer. A notebook fits into the drawer if the length of each side does not exceed the length of the corresponding aligned side of the drawer.

Janko has decided on a procedure to assign notebooks to drawers. For every notebook he will determine the number of drawers that he can fit the notebook into. Similarly, he will determine for every drawer the number of notebooks that would fit into this drawer. Then he will select the object (notebook or drawer) with the smallest number of options. If this object has no options, the procedure stops with a failure. If there are several objects with the same smallest number of options, he will select one uniformly at random. He will assign one of the options to the selected object uniformly at random. If the selected object was a notebook, he will assign it to a random drawer that can fit the notebook. If the selected object was a drawer, he will assign it to a random notebook that fits into the drawer. He will remove the assigned pair (notebook and drawer) and repeat the procedure until all notebooks are assigned to drawers.

Metka has overheard Janko's idea about placing notebooks into drawers. She is convinced that his procedure is flawed and might not succeed. Help her by writing a program that will read the number of notebooks and drawers $$$N$$$ and output a list of notebooks and a list of drawers where Janko's random greedy method doesn't necessarily find an assignment of all notebooks to drawers although such an assignment exists.

Input

The first and only line contains integer the number of notebooks and drawers $$$N$$$.

Input limits

  • $$$150 \leq N \leq 250$$$
Output

First, output $$$N$$$ lines with space-separated notebook side lengths $$$A_i$$$ and $$$B_i$$$. Next, output an empty line followed by another $$$N$$$ lines with space-separated drawer dimensions $$$X_j$$$ and $$$Y_j$$$. All dimensions should be integers between $$$1$$$ and $$$1000$$$, inclusive.

To evaluate the output of your program, we will run Janko's random greedy method on your data (notebook and drawer dimensions). Note that there must exist an assignment of all notebooks to drawers, otherwise your output will be considered as incorrect. Your solution will be evaluated on 20 test cases and Janko's method has to fail on all of them. For every test case we will run Janko's method once with a fixed random seed.

Examples
Input
1
Output
4 3

2 6
Input
3
Output
4 4
3 5
6 1

2 7
5 4
5 5