var
	i, j: longint;
	n, k: int64;

function rand(x: int64): int64;
var
	r: int64;
	i: longint;
begin
	r := 0;
	for i := 1 to 100 do begin
		r := ((r * 10 + random(10)) mod x + x) mod x;
	end;
	rand := r;
end;

begin
	for i := 1 to 1000 do begin
		n := 100000000000000000 + rand(10000000000000000);
		k := rand(trunc(sqrt(1.0 * n)));
  		writeln(n, ' ', k);
  	end;

	writeln(0, ' ', 0);
end.