pows = [2 ** i for i in range(61)] N = int(input()) ans = None for i in range(1, N): if i not in pows and N - i not in pows: ans = str(i) + ' ' + str(N - i) break print(ans if ans else '-1')