let x = read_int ()

let rec f a =
  let a' = a * a * a * a * a in

  let rec g b =
    if b = 119 then b
    else
      let b' = b * b * b * b * b in
      if a' - b' = x then b
      else g (b + 1) in

  let b = g ~-119 in
  if b < 119 then a, b
  else f (a + 1)

let () =
  let a, b = f ~-118 in
  Printf.printf "%d %d\n" a b
