program four_coloring
  implicit none
  integer :: h, w, d, c(500,500), i, j, p, q
  integer :: x(0:4000,-2000:2000)
  integer, parameter :: RYGB(0:3) = (/82,89,71,66/)
  character(500) :: s
  c = 0
  x = 0
  read(*,*) h, w, d
  do p = 0, 4000, d
    do q = -2000, 2000, d
      i = mod(p/d,2)+2*mod((q+2000)/d,2)
      x(p:min(p+d-1,4000),q:min(q+d-1,2000)) = RYGB(i)
    end do
  end do
  do i = 1, h
    do j = 1, w
      p = i+j
      q = i-j
      c(i,j) = x(p,q)
    end do
  end do
  do i = 1, h
    s = ""
    do j = 1, w
      s(j:j) = achar(c(i,j))
    end do
    write(*,'(a)') trim(adjustl(s))
  end do
  stop
end program four_coloring