There is one LED at every point with integer coordinates on the plane. Each LED has one of 8 colors, and each color is determined by whether it contains each of the red R, green G, and blue B components. The correspondence between letters and components is as follows.
Letter | Components |
|---|---|
K | |
R | R |
G | G |
B | B |
Y | R,G |
C | G,B |
M | R,B |
Initially, the colors of LEDs are given. All the other LEDs are off, and their color is K.
Every second, all LEDs are updated simultaneously. The new color of is the union of the components of the previous colors of the nine LEDs with , , including itself. That is, each component is included if at least one of them has it.
The input is given in the following format.
For each test case, output on a single line the letter representing the color of immediately after updates.
W
R,G,B |
Find the color of immediately after updates.
Each case is in the following format.
in the first line is the number of test cases. The first line of each case contains . The -th of the next lines means that the initial color of is .
| 3 | 27 | (); . |
| 4 | 60 | No additional constraints. |