import strutils
import sequtils
import algorithm
import math
import queues
import tables
import sets
import logging
import future
const INF* = int(1e18 + 373)
proc readSeq*(): seq[string] = stdin.readLine().strip().split()
proc readSeq*(n: Natural): seq[string] =
result = newSeq[string](n)
for i in 0..<n:
result[i] = stdin.readLine().strip()
proc readInt1*(): int = readSeq().map(parseInt)[0]
proc readInt2*(): (int, int) =
let a = readSeq().map(parseInt)
return (a[0], a[1])
proc readInt3*(): (int, int, int) =
let a = readSeq().map(parseInt)
return (a[0], a[1], a[2])
proc readInt4*(): (int, int, int, int) =
let a = readSeq().map(parseInt)
return (a[0], a[1], a[2], a[3])
type seq2*[T] = seq[seq[T]]
proc newSeq2*[T](n1, n2: Natural): seq2[T] = newSeqWith(n1, newSeq[T](n2))
#------------------------------------------------------------------------------#
proc placeDiamond(a: var seq2[char]; h, w, y, x, r: int; c: char) =
for dy in (-r + 1)..(r - 1):
for dx in (-r + 1)..(r - 1):
let nextY = dy + y
let nextX = dx + x
if nextY in 0..<h and nextX in 0..<w and abs(dy) + abs(dx) < r:
a[nextY][nextX] = c
proc main() =
let (h, w, d) = readInt3()
var a = newSeq2[char](h, w)
for i in 0..<h:
a[i].fill('.')
if d mod 2 == 1:
for i in 0..<h:
a[i].fill('.')
for i in 0..<h:
for j in 0..<w:
a[i][j] = (if (i + j) mod 2 == 0: 'R' else: 'B')
for i in 0..<h:
echo a[i].map(it => $it).join()
return
let r = d div 2
let dy = @[ r, (r - 1), -r, -(r - 1) ]
let dx = @[ -(r - 1), r, (r - 1), -r ]
var q = initQueue[(int, int)]()
q.enqueue((0, 0))
placeDiamond(a, h, w, 0, 0, r, 'R')
while q.len() > 0:
let (y, x) = q.dequeue()
for k in 0..<4:
let nextY = y + dy[k]
let nextX = x + dx[k]
if nextY in 0..<h and nextX in 0..<w and a[nextY][nextX] == '.':
q.enqueue((nextY, nextX))
case a[y][x]:
of 'R':
if k mod 2 == 0:
placeDiamond(a, h, w, nextY, nextX, r, 'B')
else:
placeDiamond(a, h, w, nextY, nextX, r, 'Y')
of 'Y':
if k mod 2 == 0:
placeDiamond(a, h, w, nextY, nextX, r, 'G')
else:
placeDiamond(a, h, w, nextY, nextX, r, 'R')
of 'G':
if k mod 2 == 0:
placeDiamond(a, h, w, nextY, nextX, r, 'Y')
else:
placeDiamond(a, h, w, nextY, nextX, r, 'B')
of 'B':
if k mod 2 == 0:
placeDiamond(a, h, w, nextY, nextX, r, 'R')
else:
placeDiamond(a, h, w, nextY, nextX, r, 'G')
else:
discard
for i in 0..<h:
echo a[i].map(it => $it).join()
main()