import scala.io.StdIn.readLine
import scala.io.StdIn.readInt

object Main extends App {
    val x = readLine.toLong

    def p5(a:Long): Long = {
        a*a*a*a*a
    }
    def solve() : Unit = {
         for(a:Int <- 0 to 120) {
            for(b:Int <- 0 to 120) {
                if(p5(a)+p5(b)==x) {
                    val y = a.toString + " " + b.toString
                    print(y)
                    ()
                }
                if(p5(a)-p5(b)==x) {
                    val y = a.toString + " " + (-b).toString
                    print(y)
                    ()
                }
            }
        }
    }
  solve()
}