import kotlin.math.*

fun main(args: Array<String>) {
    d()
}

fun a() {
    when(readLine()) {
        "ABC" -> println("ARC")
        "ARC" -> println("ABC")
        else -> Unit
    }
}

fun b() {
    val (N, K) = readLine()!!.split(" ").map { it.toInt() }.let { it[0] to it[1] }
    val set = (1 .. N).toMutableSet()
    repeat(K) {
        val d = readLine()!!.toInt()
        val As = readLine()!!.split(" ").map { it.toInt() }
        set.removeAll(As)
    }
    println(set.count())
}

fun c() {
    val (N, M) = readLine()!!.split(" ").map { it.toInt() }.let { it[0] to it[1] }
    val H = readLine()!!.split(" ").map { it.toLong() }
    val set = (0 until N).toMutableSet()
    repeat(M) {
        val (A, B) = readLine()!!.split(" ").map { it.toInt() - 1 }.let { it[0] to it[1] }
        when {
            H[A] == H[B] -> {
                set.remove(A)
                set.remove(B)
            }
            H[A] > H[B] -> {
                set.remove(B)
            }
            H[A] < H[B] -> {
                set.remove(A)
            }
        }
    }
    println(set.count())
}

fun d() {
    val X = readLine()!!.toLong()
    val list = divisor(X)
    list.forEach {
        val pow5 = it.toDouble().pow(5).toLong()
        when{
            pow5 == X -> { println("$it 0"); return }
            pow5 > X -> {
                var l = pow5
                var a = it
                var b = 0L
                while (l > X) {
                    a--
                    b--
                    if (l <= a*a*a*a*a - b*b*b*b*b) break
                    l = a*a*a*a*a - b*b*b*b*b
//                    println("$a^5 - $b^5 = $l")
                    if (X == l) {
                        println("$a $b")
                        return
                    }
                }
            }
            pow5 < X -> {
                var l = pow5
                var a = it
                var b = 0L
                while (l < X) {
                    a++
                    b++
                    if (l >= a*a*a*a*a - b*b*b*b*b) break
                    l = a*a*a*a*a - b*b*b*b*b
//                    println("$a^5 - $b^5 = $l")
                    if (X == l) {
                        println("$a $b")
                        return
                    }
                }
            }
        }
    }
}

fun prime(from : Long, to : Long = from) : List<Long> {
    return (from..to).filter { i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all { j ->  i % j != 0L }
    }
}

fun divisor(value : Long) : List<Long> {
    val max = Math.sqrt(value.toDouble()).toLong()
    return (1..max)
        .filter { value % it == 0L }
        .map { listOf(it, value / it) }
        .flatten()
        .sorted()
}