n = int(input()) ok = 0 for i in range(3, min(n, 6)): if i == 4: 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)