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: Runtime Error)

//This disgusting code is wriiten by Juruo D0zingbear
//Please don't hack me! 0v0 <3
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cstring>
#include <climits>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#define LL long long
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define piii pair<int, pii >
#define REP(i,n) for (int (i)=0;(i)<(n);(i)++)
#define vi vector<int>
#define vpi vector< pii >
#define INF 2147483647
#define big 19260817
#define pb push_back
#define mp make_pair
using namespace std;
const int Maxk=1005;
string mul(string a,string b){
	int res[Maxk];
	memset(res,0,sizeof(res));
	reverse(a.begin(),a.end());
	reverse(b.begin(),b.end());
	for (int i=0;i<a.length();i++){
		for (int j=0;j<b.length();j++){
			res[i+j]+=(a[i]-'0')*(b[j]-'0');
		}
	}
	for (int i=0;i<Maxk;i++){
		if (res[i]>=10) {
			res[i+1]+=(res[i]/10);
			res[i]%=10;
		}
	}
	string ret;
	bool flag=false;
	for (int i=Maxk-1;i>=0;i--){
		if (flag || res[i]){
			flag=true;
			ret=ret+(char)(res[i]+'0');
		}
	}
	if (ret=="") ret="0";
	return ret;
}
string add(string a,string b){
	if (a.length()<b.length()) swap(a,b);
	while (a.length()!=b.length()){
		b='0'+b;
	}
	for (int i=a.length()-1;i>=0;i--){
		a[i]+=(b[i]-'0');
		if (a[i]>'9' && i){
			a[i]-=10;
			a[i-1]++;
		}
	}
	if (a[0]>'9'){
		a[0]-=10;
		a='1'+a;
	}
	return a;
}

// cf IO: I64d
// atcoder IO: ｌｌｄ
inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
	return x * f;
}
const int Maxn=505;
int c[Maxn][Maxn];
bool can[Maxn][Maxn];
char kk[]=" RYGB";
int main(){
	int n,m,d;
	scanf("%d %d %d",&n,&m,&d);
	memset(can,true,sizeof(can));
	for (int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			if (can[i][j]){
				c[i][j]=1;
				for (int kx=0;kx<=d;kx++){
					int ky=d-kx;
					if (i>kx && j>ky) can[i-kx][j-ky]=false;
					if (i>kx && j+ky<=m) can[i-kx][j+ky]=false;
					if (i+kx<=n && j>ky) can[i+kx][j-ky]=false;
					if (i+kx<=n && j+ky<=m) can[i+kx][j+ky]=false;
				}
			}
		}
	}memset(can,true,sizeof(can));
	for (int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			if (can[i][j] && !c[i][j]){
				c[i][j]=2;
				for (int kx=0;kx<=d;kx++){
					int ky=d-kx;
					if (i>kx && j>ky) can[i-kx][j-ky]=false;
					if (i>kx && j+ky<=m) can[i-kx][j+ky]=false;
					if (i+kx<=n && j>ky) can[i+kx][j-ky]=false;
					if (i+kx<=n && j+ky<=m) can[i+kx][j+ky]=false;
				}
			}
		}
	}
	memset(can,true,sizeof(can));
	for (int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			if (can[i][j] && !c[i][j]){
				c[i][j]=3;
				for (int kx=0;kx<=d;kx++){
					int ky=d-kx;
					if (i>kx && j>ky) can[i-kx][j-ky]=false;
					if (i>kx && j+ky<=m) can[i-kx][j+ky]=false;
					if (i+kx<=n && j>ky) can[i+kx][j-ky]=false;
					if (i+kx<=n && j+ky<=m) can[i+kx][j+ky]=false;
				}
			}
		}
	}
	memset(can,true,sizeof(can));
	for (int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			if (can[i][j] && !c[i][j]){
				c[i][j]=4;
				for (int kx=0;kx<=d;kx++){
					int ky=d-kx;
					if (i>kx && j>ky) can[i-kx][j-ky]=false;
					if (i>kx && j+ky<=m) can[i-kx][j+ky]=false;
					if (i+kx<=n && j>ky) can[i+kx][j-ky]=false;
					if (i+kx<=n && j+ky<=m) can[i+kx][j+ky]=false;
				}
			}
		}
	}
	for (int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			assert(c[i][j]!=0);
		} 
	}
	for(int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			printf("%c",kk[c[i][j]]);
		}
		printf("\n");
	}
	return 0;
}