
fun main(args: Array<String>){

    val x = readLine()!!.toLong()


    for(a in 0..x){
        val a5 = a * a * a * a * a
        val b5 = a5 - x
        for(b in 0 until a){
            val ans = b * b * b * b * b
            if(ans == b5){
                println("$a $b")
                return
            }

            if(-ans == b5){
                println("$a -$b")
                return
            }


        }
    }

    println("ERROR $x")
}

