program dm
    implicit none
    integer::X
    integer(16)::i,j
    read*,X
    do i=0,int(sqrt(sqrt(real(X))))+1
        do j=i,int(sqrt(sqrt(real(X))))+1
            if(j**5+i**5==X)then
                print"(i0)",j,-i
                stop
            endif
            if(j**5-i**5==X)then
                print"(i0)",j,i
                stop
            endif
        end do
    end do
contains
end program dm