N = int(input()) x = 1 S = {x} while x << 1 < N: x <<= 1 S.add(x) if N < 6: print(-1) for i in range(3,N): if i in S: continue if N - i in S: continue print(i,N-i) exit()