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