program parket;
var c,s,x,y:longint;
begin
     readln(c,s);
     x:=round(sqrt(c+s));
     y:=round(sqrt(c+s));
    repeat
     if sqrt(c+s)<>round(sqrt(c+s)) then begin
                                              x:=x+1;
                                              y:=(c+s) div x;
                                         end;
    until x*y=c+s;
     writeln(x,' ',y);
end.
