import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) power_2 = set(2**n for n in range(100)) answer = (-1,) for a in range(1,N): b = N - a if a in power_2 or b in power_2: continue answer = a,b break print(*answer)