import math


def is_prime(num):
    if num <= 1:
        return False
    if num <= 3:
        return True
    if num % 2 == 0 or num % 3 == 0:
        return False
    for i in range(5, int(math.sqrt(num)) + 1, 6):
        if num % i == 0 or num % (i + 2) == 0:
            return False
    return True


n = int(input())
a, b = n // 2, n // 2
while True:
    if is_prime(a) and is_prime(b):
        break
    a -= 1
    b += 1
print(a)
print(b)