Curling up the cube 

A paper cube can be made up from six paper squares Given an projection (map) of the cube, you are to determine its correctness. A projection is correct, if a cube can be made up from it.

The Input

Input contains a projection represented as a 6*6 grid containing six ones and 30 zeroes, separated by spaces. 1s represent the paper squares. All squares are placed immediately to each other, so that each square is connected with at least one other square.

The Output

Your program should print "correct" if cube can be made up from the given project, or "incorrect" otherwise.

Sample Input 1

0 0 0 0 0 0
0 0 0 1 0 0
0 0 0 1 0 0
0 0 1 1 1 0
0 0 0 1 0 0
0 0 0 0 0 0

Sample Output 1

correct

Sample Input 2

0 0 0 0 0 0
0 0 0 1 1 0
0 0 1 1 0 0
0 0 0 1 1 0
0 0 0 0 0 0
0 0 0 0 0 0

Sample Output 2

incorrect

Alex Gevak
September 10, 2000 (Revised 2-10-00, Antonio Sanchez)