CSES - Aalto Competitive Programming 2024 - wk5 - Wed - Coloring cube
  • Time limit: 1.00 s
  • Memory limit: 512 MB

You have a cube that consists of n×n×nn \times n \times n cells. Your task is to color the cells with three colors, red, green, and blue, such that adjacent cells (i.e., cells that share a face) have different colors.

You need to produce a balanced coloring: ideally each color should appear the same number of times, but if this is not possible, you want to get as close to a perfect balance as possible. So if the numbers of red, green, and blue cells are rr, gg, and bb, you want to minimize max{r,g,b}min{r,g,b}\max \{r,g,b\} - \min \{r,g,b\}.

Input

Input is a single line with one number, nn.

Output

Print out a valid coloring of the cube. You will print out first nn lines, each with nn space-separated characters; these represent the coloring of the topmost slice of the cube. Then you print out an empty line, and another nn lines that describe the coloring of the second slice of the cube, etc., until you have printed out all nn slices. You will use characters R, G, and B to represent the coloring.

Constraints

  • 1n1001 \leq n \leq 100

Example

Input:

2

Output:

R G
B R

B R
G B