Vytautas and Jonas are playing the game "Pentago". The board is made up of four 3×3 squares. The two players take turns; on each turn a player places one marble of their own color (black or white) and then rotates one chosen square by 90° clockwise or counterclockwise. The winner is the first player who, during their own turn, lines up five marbles of their own color in a row — horizontally, vertically, or diagonally.
Vytautas (playing white) has already placed his marble on the board and now must rotate one of the squares. Determine whether he can win on this very turn. If he can, find which square he should rotate and in which direction.
The squares are numbered from 1 to 4 as shown below (square 1 is the top-left 3×3 block, square 2 the top-right, square 3 the bottom-left, and square 4 the bottom-right):

A single square may be rotated by 90° either clockwise or counterclockwise.
For example, suppose the board looks like this:

Rotating the first square by 90° counterclockwise gives:

After this rotation white has five marbles in a row, so white wins.
You are given 6 lines, each containing 6 integers, that describe the position right after the white player has placed a marble:
0 — the cell is empty;1 — the cell holds a white marble;2 — the cell holds a black marble.If white can win on this turn, print LAIMI on the first line. On the second line print two integers: the number of the square to rotate and the rotation angle needed to win. The angle is always measured counterclockwise and is either 90 (a quarter turn counterclockwise) or 270 (equivalent to 90° clockwise).
Several rotations may lead to a win. To make the answer unique, order the candidate moves first by square number (1, 2, 3, 4) and then by angle (90 before 270), and print the first winning move in that order — that is, the winning move with the smallest square number, breaking ties by the smaller angle.
If white cannot win on this turn, print NELAIMI.
The positions of the black marbles do not matter: even if a rotation simultaneously creates a row of five white marbles and a row of five black marbles, white still wins, because it is white's turn.