m@main=do s<-getLine;putStrLn$s++" = "++f(reads s);m f[(x,_:y)]=drop 3$x#read y 0#_="" x#y=" + 1/"++show(-q)++r#(-y*q)where(q,r)=divMod(-y)x