def power_two(num): while num > 1: if num % 2 != 0: return False else: num /= 2 return True def not_power_of_two(num): for i in range(num): a = i b = N - i if power_two(a) or power_two(b): continue else: return min(a, b), max(a, b) return -1 if __name__ =='__main__': N = int(input()) if not_power_of_two(N) == -1: print(-1) else: print(str(not_power_of_two(N)[0]) + ' ' + str(not_power_of_two(N)[1]) + '\n')