The Light Switching Game is played on a 1000 × 1000 × 1000 cube of cells with a light in each cell, as Figure.1 shows. Initially, most of the lights are off while exactly *N* lights are on. Two players take moves alternately. A move consists of switching the lights at the corners of a cuboid, i.e. (*x*_{1},*y*_{1},*z*_{1}), (*x*_{1},*y*_{1},*z*_{2}), (*x*_{1},*y*_{2},*z*_{1}), (*x*_{1},*y*_{2},*z*_{2}), (*x*_{2},*y*_{1},*z*_{1}), (*x*_{2},*y*_{1},*z*_{2}), (*x*_{2},*y*_{2},*z*_{1}), (*x*_{2},*y*_{2},*z*_{2}) where 1 ≤ *x*_{1 }≤* x*_{2} ≤ 1000, 1 ≤*y*_{1 }≤* y*_{2} ≤ 1000, 1 ≤*z*_{1 }≤* z*_{2} ≤ 1000 and the light at the corner (*x*_{2},*y*_{2},*z*_{2}) must be on (and turned off after the move). Notice the cuboid is possibly degenerated to a rectangle, a line or even a single cell so that the player may also switching four, two or one besides eight lights in a move. The player loses the game when he can not take a move.
Figure.1 You will find out whether the second player can win if both players play optimally.

There are multiple test cases.
Every test case starts with one line containing a single number *N* indicating the number of lights which is initially on. (*N* ≤ 100)
Each of the next *N* lines contains the coordinates (*x*, *y*, *z*) (1 ≤ *x*, *y*, *z* ≤ 1000) showing that the light at this position is on initially.

提交代码