n = int(input()) p = set() for i in range(64): p.add(2**i) if n in [1, 2, 3, 4, 5, 7]: print(-1) else: for i in range(3, n // 2 + 2): if i not in p: m = n - i if m not in p: print(i, m) break