n = int(input()) ok = 0 for i in range(3, min(n, 20)): if i == 4 or i == 8 or i == 16: continue b = n - i jou = 1 for j in range(59): if (2**j) == b: jou = 0 if jou == 1: print(i, b) ok = 1 break if ok == 0: print(-1)