# coding: utf-8

import sys



stdin = sys.stdin

ni = lambda: int(ns())

na = lambda: list(map(int, stdin.readline().split()))

ns = lambda: stdin.readline().rstrip() # ignore trailing spaces





def main():

    x = ni()

    memo = [pow(i,5) for i in range(-125,125)]

    xmod10 = x%10

    for a in range(-125, 125):

        for b in range(-125, 125):

            if (a-b)%10 == xmod10:

                if memo[a+125] - memo[b+125] == x:

                    print((a,b))

                    return

    print("Erorr")

    return





if __name__ == '__main__':

    main()
# coding: utf-8

import sys



stdin = sys.stdin

ni = lambda: int(ns())

na = lambda: list(map(int, stdin.readline().split()))

ns = lambda: stdin.readline().rstrip() # ignore trailing spaces





def main():

    x = ni()

    memo = [0.1 for _ in range(-125, 125)]

    xmod10 = x%10

    for a in range(-125, 125):

        for b in range(-125, 125):

            if (a-b)%10 == xmod10:

                if memo[a+125] == 0.1:

                    memo[a+125] = pow(a, 5)

                if memo[b+125] == 0.1:

                    memo[b+125] = pow(b, 5)

                if memo[a+125] - memo[b+125] == x:

                    print((a,b))

                    return

    print("Erorr")

    return





if __name__ == '__main__':

    main()
# coding: utf-8
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


def main():
    x = ni()
    memo = [pow(i, 5) for i in range(-125, 125)]
    xmod10 = x % 10
    for a in range(-125, 125):
        for b in range(-125, 125):
            if (a - b) % 10 == xmod10:
                if memo[a + 125] - memo[b + 125] == x:
                    print((a, b))
                    return
    print("Erorr")
    return


if __name__ == "__main__":
    main()

# coding: utf-8
import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces


def main():
    x = ni()
    memo = [0.1 for _ in range(-125, 125)]
    xmod10 = x % 10
    for a in range(-125, 125):
        for b in range(-125, 125):
            if (a - b) % 10 == xmod10:
                if memo[a + 125] == 0.1:
                    memo[a + 125] = pow(a, 5)
                if memo[b + 125] == 0.1:
                    memo[b + 125] = pow(b, 5)
                if memo[a + 125] - memo[b + 125] == x:
                    print((a, b))
                    return
    print("Erorr")
    return


if __name__ == "__main__":
    main()

-    memo = [pow(i, 5) for i in range(-125, 125)] +    memo = [0.1 for _ in range(-125, 125)] +                if memo[a + 125] == 0.1: +                    memo[a + 125] = pow(a, 5) +                if memo[b + 125] == 0.1: +                    memo[b + 125] = pow(b, 5)