A triangular board has 15 holes. The holes are laid out in 5 rows and numbered from top to bottom, and within each row from left to right, like this:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
At the start exactly one hole is empty and every other hole holds a single peg.
One move works as follows. Pick a peg together with a straight line through it (along a row, or along either of the two diagonals). If, along that line, one or more pegs sit in a row starting right next to the chosen peg, and the hole just past those pegs is empty, then the chosen peg jumps over them and lands in that empty hole. Every peg it jumped over is removed from the board. A single move may jump over several pegs at once, and it still counts as one move.
For example, when only hole 5 is empty, the peg in hole 12 can jump over the peg in hole 8 and land in hole 5 (removing the peg in hole 8); alternatively the peg in hole 14 can jump over the peg in hole 9 and land in hole 5 (removing the peg in hole 9).

Your goal is to clear the board, in as few moves as possible, down to a single peg that sits in the very hole that was empty at the start. Print the minimum number of moves required. If it can never be done, print IMPOSSIBLE.
The first line contains the number of test cases T. Each of the next T lines contains one integer, the number (from 1 to 15) of the hole that starts empty.
For each test case, print one line: the minimum number of moves needed to finish with a single peg in the hole that started empty, or IMPOSSIBLE if no sequence of moves can achieve it.