   program abc166d
      implicit none
      integer(8)::x
      integer(8)::i,j

         read *, x

         do i=-100,100,1
            do j=-100,100,1
               if ((i**5-j**5)==x) then
                  print *, i,j
                  stop
               end if
            end do
         end do

   end program abc166d