import kotlin.system.exitProcess

fun main() {
    val x = readLine()!!.toLong()
    val set = mutableSetOf<String>()

    fun calc(a: Long, b: Long) = a * a * a * a * a - b * b * b * b * b
    fun dfp(a: Long, b: Long) {
        if (a == b) return
        if (x < (a - b)) return

        val key = "$a $b"
        if (set.contains(key)) return
        set.add(key)

        val calc = calc(a, b)
        if (x == calc) {
            println(key)
            exitProcess(0)
        } else if (calc > x) {
            dfp(a, b + 1)
            return
        }

        dfp(a + 1, b)
        if (b <= 0) {
            dfp(a, b - 1)
        }
        dfp(a, b + 1)
    }

    dfp(1L, 0L)
}