- Time limit: 1.00 s
- Memory limit: 512 MB
You are given an array of integers. You will perform operations on the array.
In one operation, you will choose two numbers and from the array, delete both of them from the array and add into the array.
Your task is to find a sequence of operations such that the last number remaining in the array is .
Input
The first line has an integer : the length of the array.
The next line has integers : the contents of the array.
Output
Print lines each containing two integers and : the numbers chosen in the operations. You can print any valid solution.
If no solution exists, print only .
Constraints
Example
Input:
5 2 7 4 12 1
Output:
2 12 7 10 4 1 3 3
Explanation: The array changes as follows:
- remove and , add
- remove and , add
- remove and , add
- remove and , add
- : the final array