uses crt;
var n,a,b,q:integer;
begin
clrscr;
write('n='); readln(n);
for a:=1 to n do
for b:=a to n do
if trunc(sqrt(sqr(a)+sqr(b)))=sqrt(sqr(a)+sqr(b)) then writeln(a,' ',b);
readln;
end.
Program hotrotinhoc;
var a,b,n: longint;
function cp(x: longint): boolean;
begin
cp:=false;
if x=sqr(trunc(sqrt(x))) then cp:=true;
end;
begin
readln(n);
for a:=1 to n do
for b:=a to n do
if cp(a*a+b*b) then writeln(a,' ',b);
readln
end.