def judge(n):
for i in range(2, n):
if n % i == 0:
return False
return True
while True:
try:
n = int(input())
Min, pair = n, tuple()
for i in range(1, n):
j = n - i
if judge(i) and judge(j):
if abs(i-j) < Min:
pair = i, j
Min = abs(i-j)
print(pair[0])
print(pair[1])
except:
break