program main
  
  implicit none
  integer :: a,b,x, tmp
  integer :: ansa, ansb
  
  read(*,*) x
 
  do a = 1, 65 
    tmp = a**5 - x
    do b = -65, 65
      if ( tmp == b**5)then
        ansa = a
        ansb = b
      end if
    end do
  end do
  
  print*, ansa, ansb
  
end program main

