{
Online Pascal Compiler.
Code, Compile, Run and Debug Pascal program online.
Write your code in this editor and press "Run" button to execute it.
}
var
K,N,i,j:integer;
begin
readln(K,N);
for i:=1 to trunc(sqrt(K)) do
if K mod i = 0 then
begin
if i*(K div i+1)+(K div i)*(i+1)=N then writeln(i+1,' ',K div i+1);
end;
end.
end.