

Sahara is a two-player board game played on a hexagon-shaped grid made of 54 triangles, like the one shown in Figure (a). Each player has 6 tetrahedral pyramids, initially placed as shown in Figure (b). Player one has the dark pyramids; player two has the lighter ones.
The players take turns moving one of their own pyramids. A pyramid is moved by tipping it onto its side into an adjacent space. For example, a pyramid at location 11 can be moved to location 3, 10, or 12 (assuming the destination is free).
The objective is to trap an opponent's pyramid. A pyramid is trapped when it cannot be moved. For example, a pyramid at location 11 is trapped if locations 3, 10, and 12 are all occupied (regardless of which player owns those pyramids). Similarly, a pyramid at location 28 is trapped if both locations 17 and 29 are occupied. In Figure (c), player one can win by moving his pyramid from location 30 to location 29, trapping the opponent's pyramid at location 28.
Write a program that determines whether the first player can trap an opponent's pyramid in a single move.
The input contains one or more test cases, each on a single line. Each test case consists of 12 integers in the range 1 to 54. The first six give the locations of the first player's pyramids; the last six give the second player's. Locations are numbered as in Figure (a). The integers are separated by one or more spaces. Every test case describes a valid position in which no pyramid is already trapped.
The last line contains a single zero and is not a test case.
For each test case, print one line in the form:
k. result
where k is the test case number (starting from 1) and result is TRAPPED if the first player can trap one of the opponent's pyramids with a single move, or FREE otherwise.
The first sample test case corresponds to Figure (c); the second corresponds to Figure (d).
