- Time limit: 1.00 s
- Memory limit: 512 MB
The robot starts in the upper-left square and is directed to the right. On each step the robot acts as follows:
- Move one square forward.
- If the color of the current square differs from the color of the previous square, turn 90 degrees to the right.
- Change the color of the previous square: red becomes green, green becomes blue, and blue becomes red.
The robot may not move outside the grid, and it may use at most $10^6$ steps for its task.
Input
The only input line has two even integers $n$ and $m$.
Output
Print $n$ lines, each having $m$ characters: the coloring of the grid. The colors are red (R), green (G) and blue (B).
If there are no solutions, only print the text
IMPOSSIBLE
.Example
Input:
2 4
Output:
RRRB
BGGG
Subtask 1 (12 points)
- $n = 2$
- $2 \le m \le 100$
- $2 \le n,m \le 6$
- $2 \le n,m \le 100$