N=int(input()) s=set([2**i for i in range(100)]) for i in range(1,N): a,b=i,N-i if a in s or b in s: continue else: print(a,b) exit() print(-1)