uses sysutils;

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