program sample
implicit none
integer(8)X,B,k,i
read(*,*)X
do k=1,X
do B=-100,100
if (mod(X,k)==0) then
 if ((B+k)**5-B**5==X) then
     write(*,*)B+k,B
 end if
end if
end do
end do
stop
end program sample