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 C++14 (GCC 5.4.1) (judge verdict: Time Limit Exceeded)

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>bool chmin(T&a,const T&b){return a>b?(a=b,1):0;}
template<class T>bool chmax(T&a,const T&b){return a<b?(a=b,1):0;}


int nextInt() { int x; scanf("%d", &x); return x;}

int color[512][512];

bool check(int H, int W, int d) {
  bool ok = true;
  REP(i, H) REP(j, W) {
    REP(i2, H) REP(j2, W) {
      if (abs(i - i2) + abs(j - j2) == d) {
        if (color[i][j] == color[i2][j2]) ok = false;
        if (!ok) {
          printf("(%d,%d)-(%d,%d)\n", i, j, i2, j2);
          return false;
        }
      }
    }
  }
  cout << "OK" << endl;
  return true;
}

int H, W, d;

bool isin(int x, int y) {
  return 0 <= x && x < H && 0 <= y && y < W;
}
bool complete;
void rec(int h, int w) {
  if (w == W) {
    w = 0;
    h++;
  }
  if (h == H) {
    complete = true;
    // REP(i, H) {
    //   REP(j, W) cout << color[i][j];
    //   cout << endl;
    // }
    // cout << " " << endl;
    return;
  }

  if (color[h][w] == -1) {

    int mark = 0;
    for (int di = -d; di <= d; di++) {
      int l = abs(d - abs(di));
      for (int dj : {-l, +l}) {
        if (isin(h + di, w + dj) && color[h+di][w+dj] != -1) {
          mark |= 1 << color[h+di][w+dj] ;
        }
      }
    }
    for (int i = 0; i < 4; i++) if ((mark >> i & 1) == 0) {
      color[h][w] = i;
      rec(h, w+1);
      if (complete) return;
      color[h][w] = -1;
    }
  } else {
    rec(h, w+1);
  }
}

int main2() {
  H = nextInt();
  W = nextInt();
  d = nextInt();
  memset(color, -1, sizeof(color));
  complete = false;
  string s = "RYGB";
  
  if (d % 2 == 1) {
    REP(i, H) REP(j, W) color[i][j] = (i + j) % 2;  
    REP(i, H) {
      REP(j, W) cout << s[color[i][j]];
      cout << endl;
    }
    return 0;
  } else {
    rec(0, 0);
    REP(i, H) {
      REP(j, W) cout << s[color[i][j]];
      cout << endl;
    } 
    // check(H, W, d);
    return 0;
  }

  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws) main2();
  return 0;
}