uses sysutils;

var
	n, s : array[1..3] of integer;
	i : integer;
	u, v, up, vp : integer;
	m : integer;
	
	e : array[1..2000,1..2000] of boolean;
		
begin
	n[1] := strtoint(paramstr(1));
	n[2] := strtoint(paramstr(2));
	n[3] := strtoint(paramstr(3));
	m := strtoint(paramstr(4));
	randseed := strtoint(paramstr(5));
	
	writeln(n[1] + n[2] + n[3], ' ', m);
	
	for i := 1 to n[1] do
		write('R');
	for i := 1 to n[2] do
		write('G');
	for i := 1 to n[3] do
		write('B');
	writeln;
	
	s[1] := 1;
	for i := 2 to 3 do
		s[i] := s[i-1] + n[i-1];	
		
	fillchar(e, sizeof(e), false);
	
	for i := 1 to m do begin
		repeat
			up := random(3) + 1;
			vp := random(3) + 1;
		until up <> vp;
		
		repeat
			u := s[up] + random(n[up]);
			v := s[vp] + random(n[vp]);
		until not e[u,v];

		e[u,v] := true;
		e[v,u] := true;
		
		writeln(u, ' ', v);
	end;	
end.
