F. Anton and Perfectionism
Anton has two arrays, each containing numbers, where is an even number. He needs to create exactly pairs from these arrays, adhering to the following rules:
Each pair consists of one number from the first array and one number from the second array.
The numbers in each pair must be different.
In exactly half of the pairs, the number from the first array should be less than the number from the second array.
Help Anton by finding any valid way to form these pairs.
Input
The first line contains the even integer ().
The second line lists integers (), representing the numbers in the first array.
The third line lists integers (), representing the numbers in the second array.
Output
Output lines, each containing two integers, representing the pairs that meet the conditions.
If multiple solutions exist, you may output any of them.
If no solution is possible, output a single integer .
Examples
Note
In the first test case, the provided solution is not unique.
In the second test case, it is straightforward to verify that forming four pairs that meet the conditions is impossible.