program i_hate_factorization
    integer(8) X
    integer(8) i, j
    integer :: ans = 0
    logical :: det = .false.
    read *, X
    do i = 100, -100, -1
        if(det .eqv. .true.)exit
        do j = -100, 100, 1
            ans = (i**5)-(j**5)
            if(x == ans)then
                det = .true.
                print *, i, '', j
                exit
            end if
        end do
        
    end do
end program