#Lutece0121. Guess the Dice

Guess the Dice

Migrated from Lutece 121 Guess the Dice

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

A regular dice is a cube with 66 numbers (11 to 66) on its 66 faces. When you look at a corner of a dice you can see 33 faces and of course the numbers on them. Now you're given 88 views from 88 corners of a dice, and your task is to tell what number is on the opposite side of a given number.

Input

One integer TT on the first line indicates the number of cases.

Then followed by TT cases, every case contains 88 lines. Each line contains 33 integers AA, BB, CC describing the view from one corner of the dice (look at the picture for details).

.

It's not guaranteed that the order of the 88 views is given in the same way as the sample input.

Output

For each case, print 66 integers separated by space on a line. The ii-th number indicates the number on the opposite side of ii.

Samples

1
1 2 3
1 3 4
1 4 5
1 5 2
6 3 2
6 4 3
6 5 4
6 2 5
6 4 5 2 3 1

Resources

The 8th UESTC Programming Contest Final