program parket; var c,s:longint; a,b:longint; begin readln(c,s); if round(sqrt(s))=sqrt(s) then begin a:=round(sqrt(s))+2; b:=a; end; if (s mod 2<>0) and (round(sqrt(s))<>sqrt(s)) and (s mod 3<>0) then begin a:=s+2; b:=3; end; if (s mod 3=0) and (round(sqrt(s))<>sqrt(s)) then begin a:=s div 3+2; b:=5; end; if (s mod 5=0) and (round(sqrt(s))<>sqrt(s)) and (s mod 3<>0) then begin a:=s div 5+2; b:=7; end; if (s mod 7=0) and (round(sqrt(s))<>sqrt(s)) and (s mod 3<>0) and (s mod 5<>0) then begin a:=s div 7+2; b:=9; end; if (s mod 11=0) and (round(sqrt(s))<>sqrt(s)) then begin a:=s div 11+2; b:=13; end; if (s mod 13=0) and (round(sqrt(s))<>sqrt(s)) then begin a:=s div 13+2; b:=15; end; if (s mod 17=0) and (round(sqrt(s))<>sqrt(s)) then begin a:=s div 17+2; b:=19; end; if (s mod 19=0) and (round(sqrt(s))<>sqrt(s)) then begin a:=s div 19+2; b:=21; end; if (s mod 23=0) and (round(sqrt(s))<>sqrt(s)) then begin a:=s div 23+2; b:=25; end; if a>b then write(a,' ',b) else write(b,' ',b); end.