Problem: You are given a sequence consisting of pairwise distinct positive integers.
Find different pairs of integers and such that:
- ;
- and appear in ;
- doesn't appear in .
Note that some or can belong to multiple pairs.
denotes the floor function — the largest integer less than or equal to . denotes the remainder from dividing by .
If there are multiple solutions, print any of them. It can be shown that at least one solution always exists.
Input Format: The first line contains a single integer () — the number of testcases.
The first line of each testcase contains a single integer () — the length of the sequence.
The second line of each testcase contains integers ().
All numbers in the sequence are pairwise distinct. The sum of over all testcases doesn't exceed .
Output Format: The answer for each testcase should contain different pairs of integers and such that , and appear in and doesn't appear in . Print the pairs one after another.
You can print the pairs in any order. However, the order of numbers in the pair should be exactly such that the first number is and the second number is . All pairs should be pairwise distinct.
If there are multiple solutions, print any of them.
Note: In the first testcase there are only two pairs: and . , so we have to find one pair. , and appears in , so that pair is invalid. Thus, the only possible answer is a pair .
In the second testcase, we chose pairs and . doesn't appear in , so that answer is valid. There are multiple possible answers for that testcase.
In the third testcase, the chosen pairs are and . Neither , nor , appears in , so that answer is valid.