program main
  implicit none
  integer(8) :: x
  integer(8) :: a, b

  read *, x

  do a = -118, 119
    do b = -119, 118
      if ( a**5-b**5 == x ) then
        print *, a, b
        stop
      end if
    end do
  end do

end program main
