def is_power_of_two(x): return ((x != 0) and (x & (x - 1)) == 0); N = int(input()) b = N-3 a = 3 while is_power_of_two (a) or is_power_of_two (b): b -= 1 a += 1 if b <= 0: break if b <= 0: print(-1) else: print(a,b)