CSES - Replace with Difference
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You are given an array of nn integers. You will perform n1n-1 operations on the array.

In one operation, you will choose two numbers aa and bb from the array, delete both of them from the array and add ab|a - b| into the array.

Your task is to find a sequence of operations such that the last number remaining in the array is 00.

Input

The first line has an integer nn: the length of the array.

The next line has nn integers x1,x2,,xnx_1, x_2,\dots, x_n: the contents of the array.

Output

Print n1n-1 lines each containing two integers aa and bb: the numbers chosen in the operations. You can print any valid solution.

If no solution exists, print only 1-1.

Constraints

  • 2n10002 \le n \le 1000
  • 1xi10001 \le x_i \le 1000

Example

Input:

5
2 7 4 12 1

Output:

2 12
7 10
4 1
3 3

Explanation: The array changes as follows:

  • [2,7,4,12,1][2, 7, 4, 12, 1] \rightarrow remove 22 and 1212, add 1010
  • [7,4,1,10][7, 4, 1, 10] \rightarrow remove 77 and 1010, add 33
  • [4,1,3][4, 1, 3] \rightarrow remove 44 and 11, add 33
  • [3,3][3, 3] \rightarrow remove 33 and 33, add 00
  • [0][0]: the final array