def eval_num(num): "to judge if a particular number is prime number" flag = True for i in range(2, num): if num % i == 0: flag = False break return flag def my_func(data): for num in data: if num % 2 == 1: temp = num // 2 + 1 else: temp = num // 2 values = [] for k in range(1, temp + 1): k2 = num - k if all([eval_num(k), eval_num(k2)]): t = abs(k2 - k) values.append((t, k, k2)) res = sorted(values, key=lambda x:x[0])[0][1:] for m in res: print(m) data = [] while True: try: data.append(int(input())) except (EOFError, KeyboardInterrupt): break my_func(data)