Montgomery Burns has acquired a rod of dimensions 1×2×N (3≤N≤100000). The rod twists like a standard 3×3×3 Rubik's Cube: it can be twisted in N+1 different ways, and every twist is by a multiple of 180 degrees (see the figure below).

The rod's length has made it useful for all sorts of everyday errands: it has served Burns as a back-scratcher, a TV remote replacement, and a means to prod one Waylon Smithers. During its most recent stint as a fishing rod, however, it fell into a pond when Burns could not sustain the weight of a particularly hungry goldfish. Unfortunately, this peeled off all of the colored labels, leaving a bare rod, 6N+4 sticky labels, and a very confused goldfish splashing around in the pond.
Smithers, dutiful as ever, retrieved the labels and stuck them back onto the rod. In his haste to reaffix them before the adhesive wore off, though, he placed them back at random! Burns, exceedingly reasonable as he is, has grown wary of Smithers' work and fears the rod may no longer be solvable.
You are Lisa Simpson, and Burns has come desperately seeking your help. Determine whether the rod is solvable. The rod is solvable if there is a sequence of twists, as described above, after which two labels are the same color if and only if they lie on the same face of the rod. Note that, thanks to cheap manufacturing, the labels may have changed color while floating around in the pond, so you should rely only on which labels currently share a color, not on the specific color values.
The input consists of several test cases. The first line of each test case contains a single integer N (3≤N≤100000), the length of the rod. The following N+2 lines describe the affixed colors. Assume the rod lies flat, pointing away from you:
Each color is an integer between 0 and 5, inclusive. The input ends with a line containing N=0, which must not be processed.
For each test case, print a single line containing the word solvable (without quotes) if the rod is solvable, or unsolvable otherwise.
