import math def log(n): return math.log2(n)-int(math.log2(n)) N=int(input()) a=3 b=1 half=int(N/2) while a<=half: b=N-a if log(a)==0: a+=1 elif log(b)==0: if b!=2**math.log2(b): break else: a+=1 else: break if a>half: print(-1) else: print('%d %d'%(a,b))