Problem:
Score : 700 points

Problem Statement

We have a grid with H rows and W columns of squares.
We will represent the square at the i-th row from the top and j-th column from the left as (i,\ j).
Also, we will define the distance between the squares (i_1,\ j_1) and (i_2,\ j_2) as |i_1 - i_2| + |j_1 - j_2|.

Snuke is painting each square in red, yellow, green or blue.
Here, for a given positive integer d, he wants to satisfy the following condition:

No two squares with distance exactly d have the same color.

Find a way to paint the squares satisfying the condition.
It can be shown that a solution always exists.

Constraints

2 ≤ H, W ≤ 500

1 ≤ d ≤ H + W - 2

Input

Input is given from Standard Input in the following format:

H W d

Output

Print a way to paint the squares satisfying the condition, in the following format. If the square (i,\ j) is painted in red, yellow, green or blue, c_{ij} should be R, Y, G or B, respectively.

c_{11}c_{12}...c_{1W}
:
c_{H1}c_{H2}...c_{HW}

Sample Input 1

2 2 1

Sample Output 1

RY
GR

There are four pairs of squares with distance exactly 1.
As shown below, no two such squares have the same color.

(1,\ 1), (1,\ 2) : R, Y

(1,\ 2), (2,\ 2) : Y, R

(2,\ 2), (2,\ 1) : R, G

(2,\ 1), (1,\ 1) : G, R

Sample Input 2

2 3 2

Sample Output 2

RYB
RGB

There are six pairs of squares with distance exactly 2.
As shown below, no two such squares have the same color.

(1,\ 1) , (1,\ 3) : R , B

(1,\ 3) , (2,\ 2) : B , G

(2,\ 2) , (1,\ 1) : G , R

(2,\ 1) , (2,\ 3) : R , B

(2,\ 3) , (1,\ 2) : B , Y

(1,\ 2) , (2,\ 1) : Y , R

Solution in Ruby (2.3.3) (judge verdict: Accepted)

require 'pp'
# IS_DEBUG = true
IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end


def fill(rbase,cbase,d,h,w,color,arr)
	for i in 0..(d-1)
		for j in (i < d/2 ? (-i)..(i) : (-d+i+1)..(d-i-1))
			x = rbase+i
			y = cbase+j
			if(0 <= x && x < H && 0 <= y && y < W)
				arr[x][y] = color
			end
		end
	end
end
H,W,d=gets.chomp.split(' ').map{|n| n.to_i}
arr = Array.new(H){Array.new(W)}
r=0
# 0,0 d,0
# fill(0*d,0*d,d,H,W,"R",arr)
# puts arr.map{|l| l.join("")}.join("\n")
while(r*d<H+d)
	c=0
	while(c*d<W+d)
		color = r%2 ^ c%2 == 0 ? "R" : "Y"
		fill(r*d,c*d,d,H,W,color,arr)
		# dputs "rbase, cbase,color = #{r*d},#{c*d},#{color}"
		# dputs arr.map{|l| l.map{|a| a.nil? ? " " : a }.join("")}.join("\n")
		c+=1
	end
	r+=1
end
# start from -d/2, d/2 when (r,c)=(0,0)
r=0
while(r*d<H+d)
	c=0
	while(c*d<W+d)
		color = r%2 ^ c%2 == 0 ? "G" : "B"
		rbase = r*d-(d/2+d%2)
		cbase = c*d-(d/2)
		if(d%2==0)
			fill(rbase,cbase,d,H,W,color,arr)
		else
			fill(rbase+1,cbase-1,d-1,H,W,color,arr)
			fill(rbase+1,cbase,d-1,H,W,color,arr)
		end
		# dputs "rbase, cbase,color = #{rbase},#{cbase},#{color}"
		# dputs arr.map{|l| l.map{|a| a.nil? ? " " : a }.join("")}.join("\n")
		c+=1
	end
	r+=1
end
puts arr.map{|l| l.join("")}.join("\n")