program main
    implicit none
    integer(8) a,b,x,i,j
    read(*,*) x
    do i = 1, 1000
        do j = 1, 1000
            if ( j**5-i**5==x ) then
                a=j
                b=i
                exit
            else if ( j**5+i**5==x ) then
                a=j
                b=-i
                exit
            end if
        end do
    end do
    write(*,*) a,b
end program main