n = int(input()) def is_power_of_two(x): return (x & (x - 1)) == 0 and x != 0 invalid = {1, 2, 3, 4, 5, 7} if n in invalid: print(-1) else: candidates = [] current = 3 max_candidates = 200 while len(candidates) < max_candidates and current <= 2 * 10**5: if not is_power_of_two(current): candidates.append(current) current += 1 found = False for a in candidates: if a >= n: continue b = n - a if b <= 0: continue if not is_power_of_two(b): print(a, b) found = True break if not found: print(-1)