Program Ed;
uses crt;
var x,y,z,n:longint;
ans:boolean;
Begin
readln(n);
ans:=false;
writeln('otvet x^2+y^2+z^2=',n);
x:=-1;
repeat
inc(x); y:=-1;
repeat inc(y); z:=-1; repeat inc(z);
if sqr(x)+sqr(y)+sqr(z)=n then begin
writeln('(',x,',',y,',',z,')');
ans:=true;
end;
until z> trunc(sqrt(n));
until y> trunc(sqrt(n));
until x> trunc(sqrt(n));
if not ans then writeln('net resh');
readln;
End.
End.