main@m=getLine>>=f.map read.words>>m f[a,b]=putStrLn$[show x++" "++show(a-x)|x<-[0..],x*(a-x)==b]!!0