n = int(input()) power_of_2 = set([pow(2, i) for i in range(20)]) for i in range(1, n): if i not in power_of_2 and n - i not in power_of_2: print(min(i, n - i), max(i, n - i)) break else: print(-1)