uses sysutils;

const
	max_n = 2000;
	colnames : array[0..2] of char = ('R', 'G', 'B');
	
var
	i, n, k : integer;
	
begin
	n := strtoint(paramstr(1));
	k := strtoint(paramstr(2));
	randseed := strtoint(paramstr(3));
	
	writeln(n + k, ' ', n + k);
	
	for i := 1 to n do
		write('R');
	for i := 1 to k do
		write(colnames[random(3)]);	

	writeln;
		
	for i := 1 to n - 1 do
		writeln(i, ' ', i + 1);
	writeln(n, ' ', 1);

	for i := 1 to k do
		writeln(n + i, ' ', random(n + i - 1) + 1);	
end.
