#思路:输入num,从num/2 向前遍历,满足条件的j,num-j 为:当j和num-j都为素数时满足条件
def is_SS(num):为:
    i = 2
    while i ** 2 <= num: 
        if num % i == 0:
            return False
        i += 1
    return True
while True:
    try:
        a = int(input())
        j = a // 2
        while j > 0:
            if is_SS(j) and is_SS(a - j):
                print(j)
                print(a-j)
                break
            j -= 1
    except:
        break