#P1618A. Polycarp and Sums of Subsequences

Polycarp and Sums of Subsequences

No submission language available for this problem.

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 11, 44, 33, 1+4=51 + 4 = 5, 1+3=41 + 3 = 4, 4+3=74 + 3 = 7, 1+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.

The first line contains one integer tt (1t50001 \le t \le 5000) — the number of test cases.

Each test case consists of one line which contains 77 integers b1,b2,,b7b_1, b_2, \dots, b_7 (1bi1091 \le b_i \le 10^9; bibi+1b_i \le b_{i+1}).

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

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

Input

The first line contains one integer tt (1t50001 \le t \le 5000) — the number of test cases.

Each test case consists of one line which contains 77 integers b1,b2,,b7b_1, b_2, \dots, b_7 (1bi1091 \le b_i \le 10^9; bibi+1b_i \le b_{i+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 — a1a_1, a2a_2 and a3a_3. If there can be several answers, print any of them.

Samples

Sample Input 1

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 1

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

Note

The subsequence of the array aa is a sequence that can be obtained from aa by removing zero or more of its elements.

Two subsequences are considered different if index sets of elements included in them are different. That is, the values of the elements don't matter in the comparison of subsequences. In particular, any array of length 33 has exactly 77 different non-empty subsequences.