n = int(input()) def judg(): for i in range(1,n//2+1): if str(bin(i)).count("1")!=1 and str(bin(n-i)).count("1")!=1: print(i,n-i) return print(-1) judg()