Domino Game 

Let us consider the following version of the Domino game:

Suppose the two players are named Red and Green. Given initial sets of pieces assigned to each of Red and Green, your problem is to determine whether (i) only one of them can win, or (ii) both of them can win, or (iii) none of them can win the game. Remember that this is not a problem of finding winning strategies. You just have to find out the winning possibility of each player.

Input 

The input file may contain several instances of the problem. Each instance consists of one line in the following format:

n r11 r12 r21 r22 ... rn1 rn2 g11 g12 ... gn1 gn2

where:

An arbitrary number of blank spaces may separate a number from its neighbours in the input line of an instance. Consecutive instances are NOT separated by blank lines. The last line has n = 0.

Output 

For each instance of the problem, your program should print one line containing one of the four messages:

Only player Red can win
Only player Green can win
Both players can win
No player can win

A blank line separates the outputs of two consecutive instances.

Sample Input 

1 6 6 0 0
2 5 5 3 4 1 5 3 5
2 1 1 2 2 3 3 4 4
1 4 5 4 4
0

Sample Output 

Only player Red can win

Both players can win

No players can win

Only player Green can win



Miguel A. Revilla
2000-02-09