shunfurh 于 2017.08.31 19:24 提问

Die

One day, WashingBone and gali play a game. WashingBone shoot dice for several times, and then, gali had to guess the points number of every face of the die. Every time gali can only see three face, front, right and top, of the die.

Your task is to help gali to guess the points number of six faces of the die.

Input

There are several test cases. In every test case:

A line consist a interger number n > 0, represent the times of WashingBone shoot dice.

In next n lines, every line consist three initerger number 1 <= a, b, c <= 6, represent the front, right and top of the die.

Output

If the there is no dice can be shoot the same as input, output a "T_T", else if there are several dice can be shoot the same as input, output a "=.-", else output the front, back, right, left, bottom and top face of the die.

Because the die can be rolled, so should output the minimum sequence of the six faces, see the sample output.

Sample Input

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

Sample Output

T_T
1 6 2 3 5 4
=.-

1个回答

caozhy      2017.09.15 23:46