Problem2155--Polycarp and Sums of Subsequences(CF1618A)

2155: Polycarp and Sums of Subsequences(CF1618A)

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Polycarp had an array aa of 33 positive integers. He wrote out the sums of all non-empty subsequences of this array, sorted them in non-decreasing order, and got an array bb of 77 integers.

For example, if a={1,4,3}a={1,4,3}, then Polycarp wrote out 1144331+4=51+4=51+3=41+3=44+3=74+3=71+4+3=81+4+3=8. After sorting, he got an array b={1,3,4,4,5,7,8}.b={1,3,4,4,5,7,8}.

Unfortunately, Polycarp lost the array aa. He only has the array bb left. Help him to restore the array aa.

Input

The first line contains one integer tt (1≤t≤50001≤t≤5000) — the number of test cases.

Each test case consists of one line which contains 77 integers b1,b2,…,b7b1,b2,…,b7 (1≤bi≤10**91≤bi≤10**9bi≤bi+1bi≤bi+1).

Additional constraint on the input: there exists at least one array aa which yields this array bb as described in the statement.

Output

For each test case, print 33 integers — a1a1a2a2 and a3a3. If there can be several answers, print any of them.

Sample Input Copy

5
1 3 4 4 5 7 8
1 2 3 4 5 6 7
300000000 300000000 300000000 600000000 600000000 600000000 900000000
1 1 2 999999998 999999999 999999999 1000000000
1 2 2 3 3 4 5

Sample Output Copy

1 3 4
1 2 4
300000000 300000000 300000000
1 1 999999998
1 2 2

Source/Category