def isSuShu(x):
if x <= 2:
return True
else:
for i in range(2, int(x ** 0.5) + 1):
if x % i == 0:
return False
else:
return True
while True:
try:
n = int(input())
for i in range(int(n / 2), n):
if isSuShu(i) and isSuShu(n - i):
print(n - i)
print(i)
break
except:
break