#求出小于一个数所有的素数
def fun1(x):
    ans = []
    for n in range(2,x):
        for m in range(2,n):
            if n % m == 0:
                break
        else:
            ans.append(n)
    return ans


while True:
    try:
        #获取输入数据
        x1 = int(input())
        list1 = fun1(x1)
        temp = []
        for word in list1:
            if x1-word in list1:
                temp.append(word)
        #设置动态变量初值
        res = x1
        for k,v in enumerate(temp):
            if abs((x1-v)-v) <= res:
                res = abs((x1-v)-v)
                k1 = k
        list2 = []
        list2.append(temp[k1])
        list2.append(x1-temp[k1])
        list2.sort()
        print(list2[0])
        print(list2[1])
    except:
        break