Determine the right or left handedness of some dice.
Imagine looking at a six-sided die so two sides face east-west, two face north-south, and the last two sides face up-down. You could write down the number of dots on each side in the order: east, west, north, south, up, down.
Normal dice are labeled so that the sum of opposing sides sum to seven. This constraint is sufficient to reduce dice into two categories, "Left handed" and "Right handed." Left handed dice can be oriented so that the east face is 1, the north face is 2, and the down face is 3. Right handed dice can be oriented so that the east face is 1, the north face is 2, and the up face is 3.
In this problem, given the face values of a sequence of dice, you are to determine the handedness of the dice.
The input file will contain a sequence of one or more face descriptions of a die. These will be written as six digits (not separated by white space) on a single line. The numbers will represent (in order) the face values of the east, west, north, south, up, and down faces of the given die.
An example input file would be
column 1 1234567890 line 1:162534[EOL] 2:162543[EOL] 3:526134[EOL] :[EOF]
Other than the standard leader and trailer, the output file simply has the word "left" or "right" for each dice in the input file.
The correct output corresponding to the example input file would be
column 111111111122222222223 123456789012345678901234567890 line 1:Program 2 by team 0[EOL] 2:right[EOL] 3:left[EOL] 4:left[EOL] 5:End of program 2 by team 0[EOL] :[EOF]