One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.

For example, there is a statement called the "Goldbach's conjecture". It says: "each even number no less than four can be expressed as the sum of two primes". Let's modify it. How about a statement like that: "each integer no less than 12 can be expressed as the sum of two composite numbers." Not like the Goldbach's conjecture, I can prove this theorem.

You are given an integer n no less than 12, express it as a sum of two composite numbers.

Input

The only line contains an integer n (12 ≤ n ≤ 106).

Output

Output two composite integers x and y (1 < x, y < n) such that x + y = n. If there are multiple solutions, you can output any of them.

Examples

Input

12


Output

4 8


Input

15


Output

6 9


Input

23


Output

8 15


Input

1000000


Output

500000 500000

Note

In the first example, 12 = 4 + 8 and both 4, 8 are composite numbers. You can output "6 6" or "8 4" as well.

In the second example, 15 = 6 + 9. Note that you can't output "1 14" because 1 is not a composite number.

Difficulty: EASY
Tags: Number theory

Mathematics
Expected Time Complexity: O(1)

Starter code:

Solutions:
def isprime(k):
	m = 0
	for j in range(2, k):
		if k % j == 0:
			m = m + 1
	if m == 0:
		return 0
	else:
		return 1
n = int(input())
for i in range(4, n - 3):
	if isprime(i) == 1 and isprime(n - i) == 1:
		print(i, n - i)
		exit()


number = int(input())
one = number // 2
two = number - one
answer = False
while not answer:
	if (one % 2 == 0 or one % 3 == 0) and (two % 2 == 0 or two % 3 == 0):
		answer = True
	else:
		one -= 1
		two += 1
print(str(one) + ' ' + str(two))


n = int(input())
if n % 2 == 0:
	print('4 %d' % (n - 4))
else:
	print('9 %d' % (n - 9))


n = int(input())
if n % 2 == 0:
	x = 4
else:
	x = 9
y = n - x
print(x, y)


n = int(input())
temp = [4, n - 4]
final = []
while final == []:
	if (temp[0] % 2 == 0 or temp[0] % 3 == 0) and (temp[1] % 2 == 0 or temp[1] % 3 == 0):
		final.append(temp[0])
		final.append(temp[1])
		break
	else:
		temp[0] += 1
		temp[1] -= 1
print(*final)


n = int(input())
if n % 2 == 0:
	a = n - 4
	print('{} {}'.format(4, a))
else:
	a = n - 9
	print('{} {}'.format(9, a))


n = int(input())
if n % 2 == 0:
	print(f'{n - 8} 8')
else:
	print(f'{n - 9} 9')


from random import randint
n = int(input())

def iscomp(m):
	flag = 0
	for i in range(2, int(m / 2) + 1):
		if m % i == 0:
			flag = 1
			break
	if flag:
		return True
	else:
		return False
while True:
	p = randint(1, n - 1)
	if iscomp(p):
		q = n - p
		if iscomp(q):
			break
print(p, q)


n = int(input())
d = n % 2 + 8
print(d, n - d)


x = int(input())
if x % 2 == 0:
	print('4', x - 4)
else:
	print('9', x - 9)


n = int(input())
if n % 2:
	print(9, n - 9)
else:
	print(8, n - 8)


n = int(input())
prime = [True for i in range(n + 1)]
p = 2
while p * p <= n:
	if prime[p]:
		for i in range(p * 2, n + 1, p):
			prime[i] = False
	p += 1
i = 2
while prime[i] or prime[n - i]:
	i += 1
print(i, n - i)


prime = [True] * 1000005
prime[0] = prime[1] = False
for i in range(2, 1000005):
	if prime[i]:
		for j in range(i * i, 1000005, i):
			prime[j] = False
n = int(input())
for i in range(4, n):
	if not prime[i] and (not prime[n - i]):
		print(i, n - i)
		break


n = int(input())
print('%s %s' % (n % 2 + 8, n - (n % 2 + 8)))


n = int(input())

def c(number):
	cn = 0
	for i in range(2, int(number ** 0.5) + 1):
		if number % i == 0:
			cn += 1
	if cn != 0:
		return 1
	else:
		return 0
for i in range(n):
	j = n - i
	if c(i) == 1 and c(j) == 1:
		print(i, j)
		break


def prime(n):
	s = 0
	for i in range(int(n / 2), 0, -1):
		if n % i == 0:
			s += 1
	if s > 1:
		return False
	return True
x = int(input())
a1 = list()
a2 = list()
for i in range(1, x):
	a1.append(i)
	a2.append(x - i)
for i in range(len(a1)):
	if not prime(a1[i]) and (not prime(a2[i])):
		print(a1[i], a2[i])
		break


n = int(input())
m = 3

def sieve_of_eratosthenes(n):
	primes = [True] * (n + 1)
	p = 2
	while p * p <= n:
		if primes[p]:
			for i in range(p * 2, n + 1, p):
				primes[i] = False
		p += 1
	return primes
l = sieve_of_eratosthenes(1000000)
while l[n - m] != 0 or l[m] != 0:
	m += 1
else:
	print(m, n - m)


def isp(x):
	if x <= 1:
		return False
	else:
		i = 2
		while i * i <= x:
			if x % i == 0:
				return True
			else:
				i = i + 1
		return False
n = int(input())
for i in range(4, n - 3):
	if isp(i) & isp(n - i):
		print(i, n - i)
		break


n = int(input())
if n % 2 != 0:
	d = n - 9
	e = 9
	print(d, e)
else:
	print(8, n - 8)


def primecheck(a):
	x = False
	for i in range(2, a):
		if a % i == 0:
			x = True
			break
		else:
			continue
	return x
inp = int(input())
for i in range(4, inp - 3):
	if primecheck(i) == True:
		if primecheck(inp - i) == True:
			print(i, inp - i)
			break
		else:
			continue
	else:
		continue


n = int(input())
if n % 2 == 0:
	n1 = n - 8
	print(n1, 8)
else:
	n1 = n - 9
	print(n1, 9)


import math

def is_prime(num):
	if num == 0 or num == 1:
		return True
	for x in range(2, int(math.sqrt(num)) + 1):
		if num % x == 0:
			return False
	return True
given = int(input())
reduced = 0
while is_prime(given) or is_prime(reduced):
	given -= 1
	reduced += 1
print(given, reduced)


n = int(input())
if n % 2 == 0:
	a = 4
else:
	a = 9
b = n - a
print(a, b)


def isPrime(x):
	if x == 2 or x == 1:
		return True
	i = 2
	while i * i <= x:
		if x % i == 0:
			return False
		i += 1
	return True
n = int(input())
for x in range(1, n + 1):
	if not isPrime(x) and (not isPrime(n - x)):
		print(x, n - x)
		break


def isPrime(a):
	i = 2
	k = 0
	while i <= a // 2:
		if a % i == 0:
			k = 1
			break
		i = i + 1
	if k == 1:
		return False
	else:
		return True

def Design():
	n = int(input())
	a = b = 0
	a = n // 2
	b = n - a
	r1 = isPrime(a)
	r2 = isPrime(b)
	while r1 != False or r2 != False:
		a = a + 1
		b = n - a
		r1 = isPrime(a)
		r2 = isPrime(b)
	print(a, b)
Design()


n = int(input())
result = [[8, n - 8], [9, n - 9]]
print(*result[n % 2])


n = int(input())
if n % 2 == 0:
	print(4, n - 4)
elif n > 20:
	print('15', n - 15)
else:
	print('9', n - 9)


ai = int(input())
ti = 6
if ai / 2 == round(ai / 2):
	print(4, ai - 4)
else:
	while (ai - ti) % 2 != 0:
		ti += 3
	print(ti, ai - ti)


n = int(input())

def Sieve_of_Eratosthenes(n):
	l = list(range(2, n + 1))
	for num in l:
		if num != 0:
			for cand in range(2 * num, n + 1, num):
				l[cand - 2] = 0
	return list(filter(lambda x: x != 0, l))
l = Sieve_of_Eratosthenes(n)
for i in range(3, n):
	if i not in l and n - i not in l:
		print(i, n - i)
		break


n = int(input(''))

def isp(n):
	i = 2
	f = 0
	while i < n:
		if n % i == 0:
			f = 1
			break
		i += 1
	return f
i = 2
x = n
while i <= n:
	if isp(i) == 1 and isp(n - i) == 1 and (i + (n - i) == n):
		print(i, n - i)
		break
	i += 1


n = int(input())
b = []
if n % 2 == 0 and n % 4 == 0:
	z = []
	z.append(int(n / 2))
	z.append(int(n / 2))
	b.append(z)
else:
	for i in range(4, n - 4):
		if len(b) == 1:
			break
		q = 0
		for j in range(1, i + 1):
			if len(b) == 1:
				break
			if i % j == 0:
				q += 1
				if q > 2:
					q = 0
					x = n - i
					for j in range(1, x + 1):
						if x % j == 0:
							q += 1
							if q > 2:
								z = []
								z.append(i)
								z.append(x)
								b.append(z)
								break
print(b[0][0], b[0][1])


n = int(input())
print(str(n - 4) + ' 4' if n % 3 == 1 else str(n - 8) + ' 8' if n % 3 == 2 else str(n - 6) + ' 6')


n = int(input())
print((f'{4} {n - 4}', f'{9} {n - 9}')[n % 2])


def check(po):
	for k in range(2, po):
		if po % k == 0:
			return 1
	return 0
n = int(input())
for x in range(2, n):
	if check(x) and check(n - x):
		print(x, n - x)
		break


n = int(input())
if n % 2 == 0:
	print(f'4 {n - 4}')
else:
	print(f'9 {n - 9}')


n = int(input())
a = [0] * (n + 1)
for i in range(2, n):
	if a[i] == 0:
		for j in range(i * i, n, i):
			a[j] = 1
for i in range(4, n):
	if a[i] == 1 and a[n - i] == 1:
		print(i, n - i)
		break


n = int(input())
(x, y) = (4, 3)
while True:
	if (n - x) % y == 0:
		break
	else:
		y += 1
		if n - x < y * 2:
			x += 2
			y = 3
print(x, n - x)


from math import sqrt

def isprime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i is 0:
			return False
	return True

def go(n):
	n1 = n // 2
	n2 = n // 2
	if n % 2 is 1:
		n2 += 1
	while isprime(n1) or isprime(n2):
		n1 -= 1
		n2 += 1
	return '{} {}'.format(n1, n2)
from sys import stdin
n = int(stdin.readline().strip())
print(go(n))


num = int(input())
if num % 2 == 0:
	print('{} {}'.format(num - 4, 4))
else:
	print('{} {}'.format(num - 9, 9))


def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as c

def solve():
	N = getInt()
	if N % 2 == 0:
		return [4, N - 4]
	return [9, N - 9]
ans = solve()
print(*ans)


a = int(input())
c = a % 2 + 8
print(c, a - c)


n = int(input())
x = [6, 4, 8][n % 3]
print(x, n - x)


k = int(input())
f1 = k - 9 if k % 2 else k - 8
print(f1, k - f1)


import math
n = int(input())

def isprime(i):
	for d in range(2, math.floor(math.sqrt(i)) + 1):
		if i % d == 0:
			return False
	return True

def find(n):
	for i in range(n - 4):
		if isprime(i) == False and isprime(n - i) == False:
			return i
print(find(n), n - find(n))


n = int(input())
if n % 2 == 0:
	print(4, end=' ')
	print(n - 4)
else:
	print(9, end=' ')
	print(n - 9)


hat = int(input())

def isPrime(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	return True
if hat % 2 == 0:
	n1 = int(hat / 2)
	n2 = int(hat / 2)
	while isPrime(n1) or isPrime(n2):
		n1 -= 1
		n2 += 1
	print(n1, n2)
else:
	n1 = int(hat / 2)
	n2 = int(hat / 2) + 1
	while isPrime(n1) or isPrime(n2):
		n1 -= 1
		n2 += 1
	print(n1, n2)


n = int(input())
x = 8 + n % 2
y = n - x
print(x, y)


n = int(input())
for i in range(4, n, 2):
	if (n - i) % 2 == 0 or (n - i) % 3 == 0:
		print(i, n - i)
		break
	else:
		i += 2


k = int(input())
if k % 2 != 0:
	print(9, k - 9)
else:
	print(4, k - 4)


n = int(input())
a = 8
b = 9
if (n - a) % 2 == 0:
	print(a, n - a)
else:
	print(b, n - b)


i = int(input())
d = i % 2 + 8
print(d, i - d)


n = int(input())
for i in range(4, int(n / 2) + 1):
	if (i % 2 == 0 or i % 3 == 0) and ((n - i) % 2 == 0 or (n - i) % 3 == 0):
		x = []
		x.append(str(i))
		x.append(str(n - i))
		print(' '.join(x))
		break
	else:
		continue


def composite(x):
	for i in range(2, x):
		if x % i == 0:
			y = x
			return y
n = int(input())
for i in range(4, n, 1):
	if i == composite(i) and n - i == composite(n - i):
		print(i, n - i)
		break


def isprime(n):
	if n == 3 or n == 2:
		return True
	elif n % 2 == 0 or n % 3 == 0 or n == 1:
		return False
	else:
		return True
d = int(input())
(k, l) = (d // 2, d - d // 2)
while isprime(k) == True or isprime(l) == True:
	k = k + 1
	l = l - 1
print(l, k)


n = int(input())

def isprime(x):
	if x % 2 == 0:
		return False
	else:
		d = 3
		while d * d <= x:
			if x % d == 0:
				return False
			d = d + 2
		return True
a = n // 2
b = n - a
while isprime(a) or isprime(b):
	a = a - 1
	b = b + 1
print(a, b)


def checkPrime(x):
	idx = 0
	if x == 2 or x == 3:
		return True
	elif x <= 1:
		return False
	else:
		for i in range(2, x - 1):
			if x % i == 0:
				idx += 1
		if idx == 0:
			return True
		else:
			return False
n = int(input())
a = 3
b = 0
while checkPrime(a) or checkPrime(b):
	a += 1
	b = n - a
print(str(a) + ' ' + str(b))


import math

def isprime(n):
	bool = True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			bool = False
			break
	return bool
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for j in range(4, n // 2 + 1, 2):
		if not isprime(n - j):
			print(j, n - j)
			break


def check_prime(number):
	for i in range(2, int(number ** (1 / 2)) + 1):
		if not number % i:
			return False
	return True
z = int(input())
n1 = z // 2
n2 = z - n1
while True:
	if not check_prime(n1) and (not check_prime(n2)):
		break
	n1 -= 1
	n2 += 1
print(n1, n2)


n = int(input())
if n % 2 == 0:
	print(8, abs(n - 8))
else:
	print(9, abs(n - 9))


n = int(input())
for i in range(4, n - 3):
	if i % 2 == 0 or i % 3 == 0:
		if (n - i) % 2 == 0 or (n - i) % 3 == 0:
			print(i, n - i)
			exit()


n = int(input())
print(n % 2 * 5 + 4, n - 4 - n % 2 * 5)


x = int(input())
for i in range(4, x + 1):
	if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 or (i % 7 == 0):
		if i == 5 or i == 7:
			continue
		z = x - i
		if z % 2 == 0 or z % 3 == 0 or z % 5 == 0 or (z % 7 == 0):
			if z == 0 or z == 1 or z == 2 or (z == 3) or (z == 5) or (z == 7):
				continue
			print(i, z)
			break


n = int(input())
i = 4

def adadaval(a):
	i = 2
	c = False
	while i < a:
		if a % i == 0:
			c = True
			break
		i = i + 1
	return c
while i <= n - 4:
	d = adadaval(i)
	if d == True:
		d = adadaval(n - i)
		if d == True:
			print(i, n - i)
			break
	i = i + 1


def isPrime(x):
	c = 0
	for j in range(2, x):
		if x % j == 0:
			c = c + 1
			if c > 0:
				return True
n = int(input())
a = n // 2
b = n - a
while a != 2:
	isprime1 = isPrime(a)
	isprime2 = isPrime(b)
	if isprime1 == True and isprime2 == True:
		print(f'{a} {b}')
		break
	else:
		a = a - 1
		b = b + 1


import math
n = int(input())

def is_prime(num):
	if any((num % i == 0 for i in range(2, int(math.sqrt(num)) + 1))):
		return False
	return True
np = [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22]
for i in np:
	if i > n:
		break
	if not is_prime(n - i):
		print(n - i, i)
		break


import math
n = int(input())
is_prime = [True] * (n + 1)
for i in range(2, int(math.sqrt(n)) + 1):
	if is_prime[i]:
		for j in range(2, int(n / i)):
			is_prime[i * j] = False
x = int(n / 2)
while x >= 4:
	if not is_prime[x] and (not is_prime[n - x]):
		break
	x -= 1
print(x, n - x, sep=' ')


n = int(input())
a = 0
b = 0
if n % 2 == 0:
	a = int(n / 2)
	b = a
else:
	a = int(n / 2)
	b = a + 1
for i in range(n):
	if (a % 2 == 0 or a % 3 == 0) and (b % 2 == 0 or b % 3 == 0):
		a = a
		break
	else:
		a -= 1
		b += 1
print(a, b)


def prime_numbers_upto(n):
	lst = [True for _ in range(n + 1)]
	p = 2
	while p * p <= n:
		if lst[p] == True:
			for i in range(p * p, n + 1, p):
				lst[i] = False
		p += 1
	return lst
n = int(input())
lst = prime_numbers_upto(n)
ans = []
for i in range(len(lst)):
	if lst[i] == False and lst[n - i] == False:
		ans = [i, n - i]
		break
for a in ans:
	print(a, end=' ')


n = int(input())
n1 = 8
n2 = n - 8
if n2 % 2 == 1:
	n1 += 1
	n2 -= 1
print(f'{n1} {n2}')


n = int(input())
count = 0
if n % 2 == 0:
	a = n // 2
	b = n // 2
	for i in range(1, n // 2):
		count1 = 0
		count2 = 0
		a = a - 1
		b = b + 1
		for j in range(1, a + 1):
			if a % j == 0:
				count1 = count1 + 1
		for j in range(1, b + 1):
			if b % j == 0:
				count2 = count2 + 1
		if count1 > 2 and count2 > 2:
			print(a, b)
			break
else:
	count3 = 0
	count4 = 0
	a = n // 2 + 1
	b = n // 2
	for i in range(1, b):
		if b % i == 0:
			count3 = count3 + 1
	for i in range(1, a):
		if a % i == 0:
			count4 = count4 + 1
	if count3 > 2 and count4 > 2:
		print(a, b)
	else:
		for i in range(1, n // 2):
			count1 = 0
			count2 = 0
			a = a - 1
			b = b + 1
			for j in range(1, a + 1):
				if a % j == 0:
					count1 = count1 + 1
			for j in range(1, b + 1):
				if b % j == 0:
					count2 = count2 + 1
			if count1 > 2 and count2 > 2:
				print(a, b)
				break


a = int(input())
if a % 2 != 0:
	b = a - 9
	f = 9
else:
	b = a - 4
	f = 4
print(b, f)


n = int(input())
ans = []
prime = [2, 3, 5, 7, 11, 13]

def check_composite(n):
	is_prime = True
	for i in prime:
		if n % i == 0:
			is_prime = False
	return is_prime
x = check_composite(n)
for i in range(n):
	if i != 0 and i != 1:
		temp = n - i
		if not check_composite(temp) and temp not in prime:
			if not check_composite(i) and i not in prime:
				ans.append([temp, i])
				break
print(f'{ans[0][0]} {ans[0][1]}')


x = int(input())
if x >= 12 and x < 1000000000:
	if x % 2 == 0:
		print(4, x - 4)
	else:
		print(9, x - 9)


n = int(input())

def f(n):
	for i in range(4, n, 2):
		for j in range(i, n, 2):
			if i + j == n:
				return (i, j)
			elif i + j - 1 == n and (j - 1) % 3 == 0:
				return (i, j - 1)
print(*f(n))


import math
N = int(input())
prime = []
numberlist = []
for i in range(2, int(math.sqrt(N)) + 1):
	numberlist.append(i)
while numberlist[0] <= int(math.sqrt(math.sqrt(N))):
	now = numberlist.pop(0)
	prime.append(now)
	newnumberlist = []
	while numberlist != []:
		next = numberlist.pop(0)
		if next % now != 0:
			newnumberlist.append(next)
	numberlist = newnumberlist
prime = prime + numberlist
for i in range(2, N + 1):
	flag1 = False
	flag2 = False
	for j in range(0, len(prime)):
		if i % prime[j] == 0 and i // prime[j] != 1:
			flag1 = True
			break
	for j in range(0, len(prime)):
		if (N - i) % prime[j] == 0 and (N - i) // prime[j] != 1:
			flag2 = True
			break
	if flag1 and flag2:
		print(str(i) + ' ' + str(N - i))
		break


def deliteli(n):
	i = 1
	a = []
	while i * i <= n:
		if n % i == 0:
			a.append(i)
			if i != n // i:
				a.append(n // i)
		i = i + 1
	return a
n = int(input())
for i in range(n):
	if len(deliteli(i)) >= 3 and len(deliteli(n - i)) >= 3:
		print(i, n - i)
		break


def prim(i):
	f = 0
	for j in range(2, i):
		if i % j == 0:
			f = 1
			break
	if f == 0:
		return 1
	else:
		return 0
n = int(input())
for i in range(4, n + 1):
	f = 0
	for j in range(4, n + 1):
		if i + j == n:
			k = prim(i)
			l = prim(j)
			if k != 1 and l != 1:
				print(i, j)
				f = 1
				break
	if f == 1:
		break


n = int(input())

def com(n):
	for x in range(2, n):
		if n % x == 0:
			return True
			break
	return False
for a in range(4, n):
	if com(a) and com(n - a):
		print(a, n - a)
		break


import math

def check(m):
	q = math.ceil(math.sqrt(m))
	for i in range(2, q + 1):
		if m % i == 0:
			return True
n = int(input())
if n % 2 == 0:
	print('4' + ' ' + str(n - 4))
else:
	for j in range(5, n - 1, 2):
		if check(j):
			print(str(n - j) + ' ' + str(j))
			break


def isprime(x):
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			return 0
	return 1
i = 4
y = int(input())
while isprime(i) or isprime(y - i):
	i += 1
print(i, y - i)


n = int(input())
ans1 = 0
ans2 = 0
if n % 2 == 0:
	ans1 = 4
	ans2 = n - 4
else:
	ans1 = 9
	ans2 = n - 9
print(ans1, ans2, sep=' ')


n = int(input())
composite = [False for _ in range(n + 1)]
for i in range(2, n + 1):
	if composite[i]:
		continue
	for j in range(i * 2, n + 1, i):
		composite[j] = True
for i in range(n, 0, -1):
	if composite[i] and composite[n - i]:
		print(n - i, i)
		break


n = int(input())
i = 9 if n % 2 else 4
print(' '.join(map(str, (n - i, i))))


def isprime(k):
	for i in range(2, k):
		j = k % i
		if j == 0:
			return 0
	return 1
x = int(input())
z = range(4, 10000000, 2)
for y in z:
	c = x - y
	k = isprime(c)
	if k == 0:
		print(y, c)
		break


def isnotPrime(Number):
	for i in range(2, Number):
		if Number % i == 0 and Number != i:
			return True
	else:
		return False

def check():
	if isnotPrime(n1) and isnotPrime(n2):
		if n1 + n2 == n:
			print(n1, n2)
			exit()
n = int(input())
n1 = n // 2 + 1
n2 = n // 2
while True:
	check()
	n1 -= 1
	check()
	n1 += 1
	n2 -= 1
	check()
	n1 -= 1
	n2 += 2


n = int(input())
if n % 2 == 0:
	a = b = int(n / 2)
else:
	a = int(n / 2)
	b = a + 1

def com(k):
	for i in range(2, k):
		if k % i == 0:
			return 1
			break
	return 0
while com(a) != 1 or (com(b) != 1 and n == a + b):
	a -= 1
	b += 1
print(a, b)


n = int(input())
if n % 2 == 0:
	print(8, end=' ')
	print(n - 8)
else:
	print(9, end=' ')
	print(n - 9)


def main():
	n = int(input())
	if n % 2 == 0:
		print(4, n - 4)
	else:
		print(9, n - 9)
main()


a = int(input())
if a % 2 == 0:
	print(4, a - 4)
else:
	print(9, a - 9)


n = int(input())
output = ''
if n % 2 == 0:
	c1 = 8
else:
	c1 = 9
c2 = n - c1
print(f'{c1} {c2}')


n = int(input())
n1 = n % 2 + 8
print(n1, n - n1)


import math
n = int(input())
half = n / 2
n1 = int(math.ceil(half))
n2 = int(math.floor(half))
count = 0
temp = 0
while count < 1:
	count1 = 0
	count2 = 0
	li = [2, 3, 5, 7, 11, 13, 17, 19, 23, 27, 29, 31]
	if temp > 0:
		n1 += 1
		n2 -= 1
	if n1 in li:
		li.remove(n1)
	if n2 in li:
		li.remove(n2)
	for i in li:
		if n1 % i == 0:
			count1 += 1
		if n2 % i == 0:
			count2 += 1
		if count1 > 0 and count2 > 0:
			count += 1
	temp += 1
print(n1, n2)


n = int(input())
print(4, n - 4) if n % 2 == 0 else print(23 // 2 - 2, n - (23 // 2 - 2))


def isPrime(n):
	if n < 2:
		return False
	elif n < 4:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 3
	while i <= n ** (1 / 2):
		if n % i == 0:
			return False
		i += 2
	return True
n = int(input())
for i in range(2, n // 2 + 2):
	a = i
	b = n - i
	if not isPrime(a) and (not isPrime(b)):
		print(str(a) + ' ' + str(b))
		break


n = int(input())
for i in range(2, n):
	j = n - i
	(x, y) = (0, 0)
	for k in range(2, i):
		if i % k == 0:
			x = i
			break
	for l in range(2, j):
		if j % l == 0:
			y = j
			break
	if x != 0 and y != 0:
		print(x, y)
		break


from math import sqrt

def solve(n):
	if n % 2 == 1:
		return (9, n - 9)
	else:
		return (4, n - 4)

def main():
	n = int(input())
	print(*solve(n))
main()


def prime(n):
	a = True
	if n < 4:
		pass
	elif n == 4:
		a = False
	else:
		for i in range(2, int(n / 2)):
			if n % i == 0:
				a = False
				break
	return a
a = int(input())
i = a // 2
j = a - i
while prime(i) or prime(j):
	i -= 1
	j += 1
print(i, j)


def composite_no(a):
	for i in range(2, a):
		if a % i == 0:
			return True
	else:
		return False
n = int(input())
for i in range(n):
	x = i // 2
	y = n - x
	if composite_no(x) and composite_no(y):
		print(x, y)
		break


__author__ = 'runekri3'
n = int(input())
one_num = 8 + n % 2
print(str(one_num) + ' ' + str(n - one_num))


numbers = [1] * 1000010

def prime():
	numbers[1] = 0
	numbers[2] = 0
	for i in range(4, 1000010, 2):
		numbers[i] = 0
	for i in range(3, 1000010, 2):
		if numbers[i] == 1:
			for j in range(i + i, 1000010, i):
				numbers[j] = 0
prime()
n = int(input())
a = 4
b = n - 4
while 1:
	if numbers[a] == 0 and numbers[b] == 0:
		break
	else:
		a = a + 1
		b = n - a
print(int(a), int(b))


def isprime(k):
	if k == 2:
		return True
	else:
		for x in range(2, k):
			if k % x == 0:
				return False
		return True

def factors(n):
	for i in range(2, n):
		for j in range(2, n):
			if n == i + j:
				if isprime(i) == False and isprime(j) == False:
					return (i, j)
					break
n = int(input())
(z, y) = map(int, factors(n))
print(z, y)


def isPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n):
	a = i
	b = n - i
	if isPrime(a) or isPrime(b):
		pass
	else:
		print(a, b)
		break


n = int(input())

def pro_sost(x):
	for i in range(2, x + 1):
		if x % i == 0:
			break
	if i != x:
		return True
	else:
		return False
for i in range(3, n // 2 + 1):
	if pro_sost(i) and pro_sost(n - i):
		print(i, n - i)
		break


n = int(input())
mensitel = 4
if n % 2 == 0:
	print(8, n - 8)
else:
	print(9, n - 9)


N = int(input())
if N % 2 == 1:
	print(N - 9, 9)
else:
	print(N - 4, 4)


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
n = int(input())
if n & 1:
	print(9, n - 9)
else:
	print(8, n - 8)


n = int(input())
for i in range(4, (n + 1) // 2):
	if any((i % x == 0 for x in range(2, i))) and any(((n - i) % y == 0 for y in range(2, n - i))):
		print(i, n - i)
		break


import random

def is_composite_number(number):
	if number < 3:
		return False
	for i in range(2, number):
		if number % i == 0:
			return True
	return False
n = int(input())
a = 1
b = 1
while not is_composite_number(a) or not is_composite_number(b):
	a = random.randint(4, n - 4)
	b = n - a
print(a, b)


a = int(input())
b = []
z = 1
while a < 12 or a > 1000000:
	print('12-a deň ýa-da uly, 1000000-a deň ýa-da kiçi san yaz')
	a = int(input())
for i in range(a // 2 - 2, a // 2 + 4):
	if i % 2 == 0 or i % 3 == 0:
		b.append(i)
for d in b:
	if z == 1:
		for j in b:
			if d + j == a:
				z -= 1
				print(d, j)


x = int(input())
if x % 2 == 0:
	print(8, x - 8)
else:
	print(9, x - 9)


def iscomp(l):
	clist = []
	plist = [False] * l
	for p in range(2, l):
		if plist[p] == False:
			for i in range(p * p, l, p):
				plist[i] = True
				clist.append(i)
	return clist
n = int(input())
comp = iscomp(n)
for each in comp:
	if n - each in comp:
		print(each, n - each)
		break


def h(n):
	k = 0
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return 2
			k = 1
	if k == 0:
		return 3
n = int(input())
a = 4
b = n - 4
while h(a) % 2 != 0 or h(b) % 2 != 0:
	a = a + 1
	b = b - 1
print(a, b)


def gen_prime(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
n = int(input())
lis = gen_prime(n)
ref = []
for i in range(2, len(lis)):
	if not lis[i]:
		ref.append(i)
for i in ref:
	if n - i in ref:
		break
print(i, n - i)


a = int(input())
b = 4
c = 9
if a % 2 == 0:
	d = a - b
	print(str(b) + ' ' + str(d))
else:
	d = a - c
	print(str(c) + ' ' + str(d))


n = int(input())
if n % 2 == 1:
	print(9, n - 9)
else:
	print(4, n - 4)


n = int(input())
if not n % 2:
	print(4, n - 4)
else:
	print(9, n - 9)


def pri(num):
	if num == 2:
		return True
	if num % 2 == 0 or num <= 1:
		return False
	k = int(num / 2) + 1
	for i in range(3, k):
		if num % i == 0:
			return False
	return True
inp = int(input())
a = inp - 1
b = 1
while True:
	if pri(a) or pri(b) or a == 1 or (b == 1):
		a = a - 1
		b = b + 1
	else:
		break
print(str(b) + ' ' + str(a))


i = int(input())
if i % 2:
	print('9 ' + str(i - 9))
else:
	print('4 ' + str(i - 4))


from math import sqrt
from math import ceil

def isprime(n):
	if n == 2:
		return True
	for i in range(2, ceil(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
a = int(input())
for i in range(1, a + 1):
	j = a - i
	if not (isprime(i) or isprime(j)):
		print(i, j)
		break


def solver(N):
	if N & 1 == 0:
		return f'4 {N - 4}'
	else:
		return f'9 {N - 9}'
N = int(input())
print(solver(N))


n = int(input())
if n % 4 == 0:
	print(4, n - 4)
elif n % 4 == 1:
	print(9, n - 9)
elif n % 4 == 2:
	print(6, n - 6)
elif n == 15:
	print(6, 9)
else:
	print(15, n - 15)


n = int(input())
for i in range(4, n // 2 + 1):
	if (i % 2 == 0 or i % 3 == 0) and ((n - i) % 2 == 0 or (n - i) % 3 == 0):
		print(i, n - i)
		break


def prime(x):
	if not x & 1:
		return False
	for i in range(3, x // 2 + 1):
		if x % i == 0:
			return False
	return True
n = int(input())
x = 4
while True:
	if not prime(x) and (not prime(n - x)):
		break
	x += 1
print(x, n - x)


def isPrime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return 0
		i += 1
	return 1
n = int(input())
for i in range(2, n):
	if not isPrime(i) and (not isPrime(n - i)):
		print(n - i, i)
		break


import sys
from random import choice, randint
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	n = I()
	if n % 2 == 0:
		print(4, n - 4)
	else:
		print(9, n - 9)
main()


class TaskA(object):

	def __init__(self):
		self.n = int(input())
		self.solve()
	pass

	def solve(self):
		a = self.prime_numbers()
		for i in range(4, self.n):
			if i not in a:
				x = self.n - i
				if x not in a:
					print(i, x)
					return
	pass

	def prime_numbers(self):
		a = [x for x in range(2, self.n + 1)]
		b = [True] * len(a)
		c = dict(zip(a, b))
		for x in c.keys():
			if c[x]:
				end = self.n // x
				for i in range(2, end + 1):
					c[x * i] = False
		out = list()
		for (x, y) in c.items():
			if y:
				out.append(x)
		return out
		pass

def main():
	TaskA()
	pass
main()


n = int(input())
print(str(n - 9) + ' 9' if n % 2 else str(n - 4) + ' 4')


i = int(input())
c = i % 2 + 8
print(i - c, c)


from math import sqrt

def not_prime(n):
	n = int(n)
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
n = int(input())
for i in range(2, n - 2):
	if not_prime(i) and not_prime(n - i):
		print(i, n - i)
		break


import math
n = int(input())
T = [True] * (n + 1)
T[0] = False
T[1] = False
for i in range(2, math.ceil(math.sqrt(n))):
	for j in range(i * i, n + 1, i):
		T[j] = False
for i in range(4, n):
	if T[i] == False and T[n - i] == False:
		print(i, n - i)
		break


def com(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return 1
	return 0
n = int(input())
for i in range(2, n // 2 + 1):
	if com(i) and com(n - i):
		print(i, n - i)
		break


num = int(input())

def isPrime(num):
	try:
		for i in range(2, int(num ** 0.5) + 1):
			if num % i == 0:
				return False
	except IndexError:
		pass
	return True
for i in range(2, num):
	if not isPrime(i) and (not isPrime(num - i)):
		print(str(i) + ' ' + str(num - i))
		break


n = int(input())
x = 0
y = 0
x1 = []
y1 = []
if n < 4:
	x = n - 2
	y = n - x
	print(x, y)
elif n >= 12:
	if n % 2 == 0:
		x = n - 4
		y = n - x
		print(x, y)
	else:
		s = n - 4 - 1
		x = s - 4
		y = n - x
		print(x, y)


n = int(input())

def is_composite(n):
	for i in range(n - 2):
		if n % (i + 2) == 0:
			return True
	return False
for i in range(n - 2):
	x = i + 2
	y = n - x
	if is_composite(x) and is_composite(y):
		print('{} {}'.format(x, y))
		break


n = int(input())
if n % 2 and n < 19:
	print(n - 9, 9)
elif n % 2:
	print(9, n - 9)
else:
	print(4, n - 4)


n = int(input())
if n % 6 == 0:
	print(str(int(n / 2)) + ' ' + str(int(n / 2)))
elif n % 6 == 1 or n % 6 == 3 or n % 6 == 5:
	print(str(int(n - 9)) + ' ' + str(9))
elif n % 6 == 2 or n % 6 == 4:
	print(str(int(n - 4)) + ' ' + str(4))


n = int(input())
if n % 2 == 0:
	print(2 * (n // 2 - 4), 8, sep=' ')
else:
	print(2 * (n // 2 - 4), 9, sep=' ')


n = int(input())
if n % 3 == 0:
	print(6, n - 6)
if n % 3 == 1:
	print(4, n - 4)
if n % 3 == 2:
	print(8, n - 8)


def isnotprime(x):
	for i in range(2, x):
		if x % i == 0:
			return True
	return False
i = 2
x = eval(input())
while True:
	if isnotprime(i) and isnotprime(x - i):
		print(x - i, i)
		break
	else:
		i = i + 1


def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
a = 4
b = n - 4
while isprime(a) or isprime(b):
	a = a + 1
	b = b - 1
print(a, b)


n = int(input())
if n & 1:
	print(9, n - 9)
else:
	print(6, n - 6)


def isprime(n):
	if n == 2 or n == 3:
		return True
	else:
		b = int(n ** 0.5)
		for i in range(2, b + 1):
			if n % i == 0:
				return False
	return True
number = int(input())
tag = 0
for i in range(2, number):
	for j in range(2, number):
		if i + j == number and isprime(i) == isprime(j) == False:
			print(str(i) + ' ' + str(j))
			tag = 1
			break
	if tag == 1:
		break


n = int(input())
x = [4, 9][n % 2]
print(x, n - x)


d = [False] * 1000001
a = set()
for i in range(2, 1000001):
	if not d[i]:
		a.add(i)
		for j in range(i, 1000001, i):
			d[j] = True
n = int(input())
for i in range(2, n - 2):
	if not i in a and (not n - i in a):
		print(i, n - i)
		exit()


def f(a):
	if not a % 2:
		return 1
	i = 3
	while i * i <= a:
		if not a % i:
			return 1
		i += 2
	return 0
a = int(input())
if not a % 2:
	print(4, a - 4)
else:
	b = 4
	while 1:
		if f(b) & f(a - b):
			break
		b += 1
	print(b, a - b)


n = int(input())

def check(x):
	ret = False
	for y in range(2, x):
		if x % y == 0:
			ret = True
			break
	return ret
if n % 2 == 0 and check(n // 2):
	print(n // 2, n // 2)
else:
	for x in range(2, n, 1):
		if check(x):
			if check(n - x):
				break
	print(n - x, x)


number = int(input())
if (number - 4) % 3 == 0:
	print('4' + ' ' + str(number - 4))
elif (number - 6) % 3 == 0:
	print('6' + ' ' + str(number - 6))
else:
	print('8' + ' ' + str(number - 8))


n = int(input())
if n % 2 == 0:
	print('{} {}'.format(8, n - 8))
else:
	print('{} {}'.format(9, n - 9))


def primo(b):
	for k in range(2, b):
		if b % k == 0:
			return False
	return True

def sumt(n):
	for k in range(4, n - 3):
		if primo(k) == False and primo(n - k) == False:
			return str(k) + ' ' + str(n - k)
n = int(input(''))
print(sumt(n))


def aval(a):
	cnt = 0
	for j in range(1, a):
		if a % j == 0:
			cnt += 1
	if cnt != 1:
		return 1
	else:
		return 0
n = int(input())
for i in range(4, n + 1):
	a = i
	b = n - a
	if aval(a) + aval(b) == 2:
		print(a, b)
		break


import math

def prime(x):
	if x < 2:
		return False
	if x == 2:
		return True
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return False
	return True
n = int(input())
a = n - 4
while prime(a):
	a -= 2
b = n - a
print(a, b)


import math
n = int(input())

def checkComposite(n):
	t = bool
	if n % 2 == 0 or n % 3 == 0:
		t = True
	else:
		i = 5
		while i * i <= n:
			if n % i == 0 or n % (i + 2) == 0:
				t = True
				break
			i += 6
		t = False
	return t
v1 = math.ceil(n / 2)
rm = n - v1
if v1 == rm:
	v1 -= 1
	rm += 1
	while not (checkComposite(v1) and checkComposite(rm)):
		v1 = v1 - 1
		rm = rm + 1
	print(v1, rm)
else:
	while not (checkComposite(v1) and checkComposite(rm)):
		v1 = v1 - 1
		rm = rm + 1
	print(v1, rm)


n = int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 58109, 761, 100003, 999983]
if n - 4 not in prime:
	print(4, n - 4)
elif n - 6 not in prime:
	print(6, n - 6)
else:
	print(8, n - 8)


numbr = int(input())
x1 = 0
x2 = 0
if numbr % 2 == 0:
	x1 = numbr / 2
	x2 = numbr / 2
else:
	numr = (numbr - 1) / 2
	x1 = numr
	x2 = numr + 1
while x1 % 2 != 0 and x1 % 3 != 0 or (x2 % 2 != 0 and x2 % 3 != 0):
	x1 = x1 - 1
	x2 = x2 + 1
print(str(int(x1)) + ' ' + str(int(x2)))


n = int(input())
a = 0
b = 0
if n % 2 == 0:
	a = 4
	b = n - 4
elif n % 3 == 0:
	a = 6
	b = n - 6
elif n % 3 == 1:
	a = 4
	b = n - 4
else:
	a = 8
	b = n - 8
print(a, b)


import math

def primenum(x):
	count = 0
	for i in range(2, int(math.floor(math.sqrt(x))) + 1):
		if x % i == 0:
			count = count + 1
	if count == 0:
		return True
	else:
		return False
n = int(input())
for i in range(2, 100):
	if primenum(n - i) == False and primenum(i) == False:
		print(i, n - i)
		break


n = int(input())
if n % 2 == 0 and n / 2 % 2 == 0:
	print(int(n / 2), int(n / 2))
else:
	found = 0
	even = 4
	while found == 0:
		a = n - even
		i = 2
		while i < a / 2 + 1:
			if a % i == 0:
				print(even, a)
				found = 1
				break
			i += 1
		even += 2


N = int(1000000.0 + 1)
sieve = [True] * N
for i in range(2, N):
	if sieve[i]:
		for j in range(i + i, N, i):
			sieve[j] = False
n = int(input())
for i in range(4, n):
	if not sieve[i] and (not sieve[n - i]):
		print(i, n - i)
		break


n = int(input())
n1 = 4
n2 = n - 4
while n2 >= 9 and n2 % 3 != 0 and (n2 % 5 != 0):
	n1 += 2
	n2 -= 2
print(n1, n2)


n = int(input())
for x in range(4, n, 2):
	for y in range(2, n - x):
		for z in range(2, x):
			if x % z == 0 and (n - x) % y == 0:
				print(str(x) + ' ' + str(int(n - x)))
				exit()
			else:
				continue


n = int(input())
m = n % 10
if m % 2 == 1:
	(a, b) = (9, n - 9)
	print(min(a, b), max(a, b))
else:
	(a, b) = (4, n - 4)
	print(min(a, b), max(a, b))


k = int(input())
print(k % 2 + 8, k - k % 2 - 8)


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return (self.nextint() for i in range(n))

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)

def iscomposite(n):
	if n < 4:
		return False
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
n = nextint()
for i in range(2, n):
	if iscomposite(i) and iscomposite(n - i):
		print(i, n - i)
		break


n = int(input())
arr = [4]
i = 6
while i <= n:
	if i % 6 == 0 or (i - 2) % 6 == 0 or (i - 3) % 6 == 0 or ((i - 4) % 6 == 0):
		arr.append(i)
	i = i + 1
j = 0
while j < len(arr):
	if arr[j + 1:].count(n - arr[j]) >= 1:
		a = arr[j]
		b = n - arr[j]
		break
	j = j + 1
print(a, b)


n = int(input())
if n % 2 == 0:
	a = n // 2
	a -= 2
	a *= 2
	print(n - a, a)
else:
	a = n // 2
	a -= 4
	a *= 2
	print(n - a, a)


def p(a):
	for i in range(2, a):
		if a % i == 0:
			return True
		else:
			continue
	if i == a - 1:
		return False
import math
n = int(input())
a = math.floor(n / 2)
b = math.ceil(n / 2)
while True:
	if p(a) and p(b):
		print(a, end=' ')
		print(b)
		break
	else:
		a += 1
		b -= 1


import math
sqrt = math.sqrt

def isPrime(n):
	limite = int(sqrt(n)) + 1
	if n == 2:
		return True
	if n % 2 == 0 or n == 1:
		return False
	for i in range(3, limite, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
a = n - 2
b = 2
div = 3
while True:
	if isPrime(a) or isPrime(b):
		a -= 1
		b += 1
	else:
		break
print(a, b)


def prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(3, n):
		if prime(i) == False and prime(n - i) == False:
			print(i, n - i)
			break


import math
status = {}

def siv():
	N = 1000000
	for i in range(N + 1):
		status[i] = 0
	sq = int(math.sqrt(N))
	for i in range(4, N + 1, 2):
		status[i] = 1
	for i in range(3, sq + 1, 2):
		if status[i] == 0:
			j = i * i
			while j <= N:
				status[j] = 1
				j += i
	status[1] = 1
siv()
n = int(input())
i = 4
j = n - 4
(x, y) = (-1, -1)
while i < j:
	if i + j == n and status[i] == 1 and (status[j] == 1):
		x = i
		y = j
		break
	i += 1
	j -= 1
print(x, y, sep=' ')


def prime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(4, n // 2 + 1):
		if not prime(i) and (not prime(n - i)):
			break
	print(i, n - i)


def isprime(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return False
	else:
		return True
n = int(input())
for i in range(3, n - 3):
	if isprime(i) is False:
		if isprime(n - i) is False:
			print(i, n - i)
			break


import math

def iscomposite(a):
	cur = 2
	sq = math.sqrt(a)
	while a % cur != 0:
		cur += 1
		if cur > sq:
			return False
	return True
i = int(input())
a = 4
b = i - 4
while not iscomposite(a) or not iscomposite(b):
	a += 1
	b -= 1
print(a, b)


def check(a):
	b = 1
	x = 0
	while b <= a:
		if a % b == 0:
			x += 1
		b += 1
	if x == 2:
		return 0
	else:
		return 1
n = int(input())
t = 2
for i in range(t, n):
	if check(i) == 1 and check(n - i) == 1:
		print(i, n - i)
		break


i = int(input())
a = 4
while (i - a) % 6 in [1, 5]:
	a += 2
print(a, i - a)


def isComposite(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
for i in range(n):
	temp = n - i
	if isComposite(temp) and isComposite(i):
		print('{} {}'.format(i, temp))
		break


k = int(input())
n = k - 10
x = 2 * n % 3
y = int((n - 2 * x) / 3)
x = 2 * x + 4
y = 3 * y + 6
print(str(x) + ' ' + str(y))


def prime(x):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return False
	return True
n = int(input())
k = 4
a = n - k
b = n - a
while prime(a) or prime(b):
	k += 1
	a = n - k
	b = n - a
print(a, b)


from math import sqrt
number = int(input())

def prime_check(n):
	if n == 2:
		return True
	if n == 1 or n == 0:
		return False
	for i in range(2, int(sqrt(n) + 1)):
		if n % i == 0:
			return False
	return True
i = 4
j = number - i
while prime_check(i) or prime_check(j):
	i += 1
	j -= 1
print(i, j)


def sumSost(n):
	if n % 2 == 0:
		print(4, n - 4)
	else:
		print(9, n - 9)
sumSost(int(input()))


n = int(input())
if n % 2:
	print('{} {}'.format(9, n - 9))
else:
	print('{} {}'.format(4, n - 4))


def prime(a):
	if a == 1:
		return False
	else:
		count = 0
		i = 2
		while i < a // 2 + 1:
			if a % i == 0:
				count += 1
				break
			else:
				i += 1
		if count == 0:
			return True
		else:
			return False
num = int(input())
if num % 2 == 0 and prime(num // 2) == False and (prime(num // 2) == False):
	print(num // 2, num // 2)
else:
	i = 4
	a = 1
	while a > 0:
		a = num - i
		if prime(a) == False and prime(i) == False:
			print(a, i)
			break
		i += 1


n = int(input())
if n % 2 == 0:
	if n // 2 % 2 == 0:
		print(n // 2, n // 2)
	else:
		a = n // 2
		print(a - 1, a + 1)
else:
	print('9', n - 9)


import math

def isprime(x):
	if x >= 2:
		for y in range(2, x):
			if not x % y:
				return 0
	else:
		return 0
	return 1
n = int(input())
if n % 2 == 0 and isprime(n // 2) == 0:
	print(math.ceil(n / 2), math.ceil(n / 2))
else:
	for i in range(2, n):
		if isprime(i) == 0 and isprime(n - i) == 0:
			print(i, n - i)
			break


n = int(input())
k = 4

def cn(g):
	for i in range(2, g):
		if g % i == 0:
			return True
		elif i == g - 1:
			return False
while k < n:
	if cn(k) * cn(n - k) != 0:
		p = True
		break
	else:
		p = False
		k = k + 1
if p == True:
	print(k, n - k)
else:
	print('NO')


def gcd(a):
	i = 1
	mas = []
	while i ** 2 <= a:
		if a % i == 0:
			mas.append(i)
			if i != a // i:
				mas.append(a // i)
		i += 1
	return len(mas)

def composite(x):
	for i in range(1, x + 1):
		if gcd(i) > 2 and gcd(x - i) > 2:
			return (i, x - i)
print(*composite(int(input())))


import math

def isprime(n):
	if n in [2, 3, 5, 7, 11]:
		return True
	a = math.ceil(math.sqrt(n))
	for i in range(2, a + 1):
		if n % i == 0:
			return False
	else:
		return True

def notprime(n):
	if isprime(n):
		return False
	else:
		return True
a = int(input())
if a % 2 == 0:
	b = int(a / 2)
	c = int(a / 2)
else:
	b = int(math.floor(a / 2))
	c = int(math.ceil(a / 2))
if notprime(b) and notprime(c):
	print(b, c)
else:
	while b > 1 and c > 1:
		b -= 1
		c += 1
		if notprime(b) and notprime(c):
			print(b, c)
			break


def isComposite(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
x = int(input())
for i in range(4, x):
	if isComposite(i) and isComposite(x - i):
		print('{a} {b}'.format(a=i, b=x - i))
		break


n = int(input())
if n % 2 == 0:
	ans_1 = 4
	ans_2 = n - 4
	print(ans_1, ans_2)
else:
	ans_1 = 9
	ans_2 = n - 9
	print(ans_1, ans_2)


n = int(input())
k = 0
import math
for i in range(4, n - 1):
	j = 2
	c = 0
	while j <= math.sqrt(i):
		if i % j == 0:
			c = 1
			break
		j += 1
	if c == 1:
		p = n - i
		if p > 2:
			j = 2
			while j <= math.sqrt(p):
				if p % j == 0:
					k = 1
					break
				j += 1
			if k == 1:
				break
	if k == 1:
		break
if k == 1:
	print(i, p)


n = int(input())
k = n // 2
firstComposite = 2 * (k - 4)
if n % 2 == 0:
	print(str(firstComposite) + ' 8')
else:
	print(str(firstComposite) + ' 9')


def iscomp(n):
	if n <= 1:
		return 0
	if n == 2 or n == 3:
		return 0
	if n % 2 == 0:
		return 1
	i = 3
	while i * i <= n:
		if n % i == 0:
			return 1
		i = i + 2
	return 0
n = int(input())
for i in range(2, n // 2 + 1):
	if iscomp(i) == 1 and iscomp(n - i) == 1:
		print(i, n - i)
		break


__author__ = 'curiousfool'
import math

def prime(number):
	fact = 0
	i = 2
	while i <= math.sqrt(number):
		if number % i == 0:
			return 1
		i += 1
	return 0
n = int(input())
for i in range(2, n - 1):
	if prime(i) and prime(n - i):
		print(i, n - i)
		break


import math

def Sieve_of_E(n, prime):
	p = 2
	while p * p < n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
s = [True] * (10 ** 6 + 1)
Sieve_of_E(10 ** 6, s)
n = int(input())
for i in range(4, n // 2 + 1):
	if not s[i]:
		if not s[n - i]:
			print(i, n - i)
			break


def prime(i):
	for j in range(2, i):
		if i % j == 0:
			return 'NO'
	else:
		return 'YES'
n = int(input())
for i in range(2, n):
	for j in range(i, n):
		if i + j == n:
			if prime(i) == 'YES':
				i += 1
				continue
			elif prime(j) == 'YES':
				j += 1
				continue
			else:
				print(i, j)
				exit()


def is_not_prime(num):
	i = 2
	while i < num:
		if num % i == 0:
			return True
		i += 1
	return False
n = int(input())
i = 4
j = 4
p = 0
while i < n - 3:
	if is_not_prime(i):
		j = 4
		while j < n - 3:
			if i + j == n and is_not_prime(j):
				print(i, j)
				p += 1
				break
			j += 1
	i += 1
	if p > 0:
		break


def composite(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return True
	return False
num = int(input())
for i in range(4, num - 4):
	if composite(i) and composite(num - i):
		print(i, ' ', num - i)
		break


N = int(input())
if N % 2 == 0:
	print(N - 4, '4')
else:
	print(N - 9, '9')


import math
n = int(input())
composite = []
tmp = int(math.sqrt(n)) + 1
for i in range(2, tmp + 1):
	for j in range(2, tmp + 1):
		if i * j > n:
			break
		composite.append(i * j)
for x in list(set(composite)):
	if n - x in composite:
		print(str(x) + ' ' + str(n - x))
		break


def simple(n):
	a = set()
	i = 1
	while i ** 2 <= n:
		if n % i == 0:
			a.add(i)
			a.add(n // i)
		i += 1
	if len(a) > 2:
		return 'Составное'
	return 'Простое'
x = int(input())
for i in range(x // 2 + 1):
	if simple(i) == 'Составное' and simple(x - i) == 'Составное':
		print(i, x - i)
		break


def is_composite(number):
	if number <= 1:
		return True
	i = 2
	while i * i <= number:
		if number % i == 0:
			return False
		i += 1
	return True
n = int(input())
m = 0
while n > 0:
	if not is_composite(n) and (not is_composite(m)):
		print(n, m)
		break
	(n, m) = (n - 1, m + 1)


a = int(input())
if a % 2 == 0:
	print(str(8) + ' ' + str(a - 8))
else:
	print(str(9) + ' ' + str(a - 9))


vorgabe = int(input())
num1 = 0
num2 = 0
mid = 0
mid2 = 0
if vorgabe % 2 == 0:
	mid = vorgabe // 2
	mid2 = vorgabe // 2
	while mid2 > 0:
		if mid % 2 != 0 and mid % 3 != 0 or (mid2 % 2 != 0 and mid2 % 3 != 0):
			mid += 1
			mid2 -= 1
		else:
			print(mid, mid2)
			break
if vorgabe % 2 != 0:
	mid = vorgabe // 2
	mid2 = vorgabe // 2 + 1
	while mid2 > 0:
		if mid % 2 != 0 and mid % 3 != 0 or (mid2 % 2 != 0 and mid2 % 3 != 0):
			mid += 1
			mid2 -= 1
			if mid2 == 1 or mid == 1:
				print('no way')
				break
		else:
			print(mid, mid2)
			break


n = int(input())
for i in range(1, n):
	y = n - i
	x = n - y
	if [i for i in range(2, y - 1) if not y % i] and [i for i in range(2, x - 1) if not x % i]:
		print(x, y)
		break


n = int(input())
if n % 2 == 0:
	x = n // 2
	y = n // 2
else:
	x = n // 2
	y = n - x
lx = [x]
ly = [y]
while x + y == n:
	i = 1
	while i <= x // 2:
		if x % i == 0:
			lx.append(i)
		i += 1
	i = 1
	while i <= y // 2:
		if y % i == 0:
			ly.append(i)
		i += 1
	if len(lx) > 2 and len(ly) > 2:
		print(x, y)
		break
	else:
		x += 1
		y -= 1
		lx = [x]
		ly = [y]


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
for i in range(4, n):
	if isPrime(i):
		continue
	else:
		m = n - i
		if isPrime(m):
			continue
		else:
			print(i, m)
			break


def prime(n):
	count = 0
	for i in range(1, n // 2 + 1):
		if n % i == 0:
			count += 1
		if count == 2:
			break
	if count == 2:
		return True
	else:
		return False
n = int(input())
for i in range(1, n // 2 + 1):
	if prime(i) and prime(n - i):
		print(str(i) + ' ' + str(n - i))
		break


def delit(x):
	a = []
	i = 1
	while i ** 2 <= x:
		if x % i == 0:
			if i != x // i:
				a.append(i)
				a.append(x // i)
			else:
				a.append(i)
		i += 1
	return a

def sostav(x):
	if len(delit(x)) > 2:
		return x
	else:
		return 0

def end(n):
	if n >= 12:
		for i in range(1, n + 1):
			a = []
			if sostav(i) > 0 and sostav(n - sostav(i)) > 0:
				a.append(i)
				a.append(n - i)
				return a
print(*end(int(input())))


n = int(input())
if n % 2 == 0:
	print(str(4) + ' ' + str(n - 4))
elif n <= 17:
	print(str(n - 9) + ' ' + str(9))
else:
	print(str(9) + ' ' + str(n - 9))


def main():
	r = int(input())
	if r % 2 == 1:
		print(9, r - 9)
	else:
		print(4, r - 4)
main()


def is_prime(x):
	t = 1
	for i in range(2, x):
		if x % i == 0:
			return False
	return True
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(4, n // 2 + 1):
		if is_prime(i):
			continue
		if is_prime(n - i):
			continue
		print(i, n - i)
		break


n = int(input())
m = n % 2 + 8
u = n - m
print(m, u)


n = int(input())

def factors(z):
	if z % 2 == 0 or z % 3 == 0:
		return 0
	k = 5
	for i in range(z):
		if k * k <= z:
			if z % k == 0 or z % (k + 2) == 0:
				return 0
			k = k + 6
		else:
			break
	return z
a = n - n // 2
b = n - a
for i in range(b):
	if factors(b) == 0 and factors(a) == 0:
		print(a, b)
		break
	else:
		a = a + 1
		b = b - 1


def isprime(a):
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return False
	return True
a = int(input())
if a % 2 == 0:
	print(4, a - 4)
else:
	for i in range(4, a, 2):
		if not isprime(a - i):
			print(i, a - i)
			break


n = input()
n = int(n)
s = n ** 0.5 // 1
finish = False
i = 0
b = 1
while not finish and b > 0:
	a = n // 2 + i
	b = n - a
	no = False
	j = 1
	bq = b ** 0.5 // 1
	aq = a ** 0.5 // 1
	finishA = False
	finishB = False
	while not no and j < aq:
		j = j + 1
		if not finishA and a % j == 0:
			finishA = True
		if not finishB and j <= bq and (b % j == 0):
			finishB = True
		if not finishB and j > bq:
			no = True
		if finishB and finishA:
			no = True
			finish = True
	i = i + 1
print(str(a) + ' ' + str(b))


S = int(input())
W = []
for i in range(4, S - 3):
	a = i
	b = S - i
	for i in range(2, a):
		if a % i == 0:
			for i in range(2, b):
				if b % i == 0:
					print(str(int(a)) + ' ' + str(int(b)))
					W.append(1)
					break
		break
	if W != []:
		break


n = int(input())
if n & 1:
	print('9 ' + str(n - 9))
else:
	print('4 ' + str(n - 4))


def findNums(n):
	if n % 2 == 0:
		print('4 ', n - 4, end=' ')
	else:
		print('9 ', n - 9, end=' ')
n = int(input())
findNums(n)


n = int(input())

def composite(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
for i in range(4, n):
	a = composite(i)
	b = composite(n - i)
	if a and b:
		print(i, n - i)
		break


def sostav_num(s):
	for i in range(2, s):
		if s % i == 0:
			return True
n = int(input())
for j in range(2, n):
	if sostav_num(j) and sostav_num(n - j) is True:
		break
print(j, n - j)


n = int(input())

def primee(q):
	a = ''
	for i in range(2, q):
		if q % i == 0:
			a = False
			break
		else:
			a = True
	return a
x = 4
while primee(n - x) == True:
	x = x + 2
print(x, n - x)


import math
__author__ = 'widoc'

def check_for_div(x):
	cnt = 1
	for i in range(2, math.floor(x // 2) + 1):
		if x % i == 0:
			cnt += 1
		if cnt >= 2:
			return True
	return False

def check_val(a, b):
	while True:
		if a == 1:
			return None
		if check_for_div(a) and check_for_div(b):
			return [a, b]
		else:
			a -= 1
			b += 1
n = int(input())
a = b = 0
if n % 2 == 0:
	a = b = n // 2
else:
	a = (n + 1) // 2
	b = n - a
res = check_val(a, b)
if res:
	print('{0} {1}'.format(res[0], res[1]))


import math
a = int(input())
l = []
nub = 0
b = a / 2
if b % 2 == 0:
	print(int(b), int(b))
else:
	for i in range(int(b) - 1):
		d = int(b) - i
		if d % 2 == 0 and (a - d) % 2 == 0 or (d % 2 == 0 and d % math.sqrt(a - d) == 0):
			print(int(d), int(a - d))
			break
		elif d % math.sqrt(d) == 0 and (a - d) % 2 == 0:
			print(int(d), int(a - d))
			break
		elif d % 2 == 0 and math.sqrt(a - d) in range(2, 999):
			print(int(d), int(a - d))
			break


def check(a):
	for i in range(2, int(a ** (1 / 2)) + 1):
		if a % i == 0:
			return 1
	return 0
num = int(input())
if num % 2 == 0 and check(num / 2) == 1:
	x = int(num / 2)
	print(x, x)
else:
	for f in range(4, num - 4):
		num_s = num - f
		if check(f) == 1 and check(num_s) == 1:
			print(f, num_s)
			break


import math

def f(n):
	if n < 2:
		return False
	if n == 2:
		return True
	if n % 2 == 0:
		return False
	k = int(math.sqrt(n))
	for i in range(2, k + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
ok = False
for _ in range(2, 100):
	if not f(_):
		if not f(n - _):
			print(_, n - _)
			exit(0)


number = int(input())
for i in range(2, int(number / 2) + 1):
	if any((not i % b for b in range(2, i))) and any((not (number - i) % b for b in range(2, number - i))):
		print(i, number - i)
		break


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
l = 2
h = n - 2
while l <= n:
	if isPrime(l) == False and isPrime(h) == False:
		print(l, h)
		exit()
	else:
		l += 1
		h -= 1


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
N = get_int()
sieve = [1] * N
sieve[0] = 0
sieve[1] = 0
i = 2
while i * i < N:
	if sieve[i] == 0:
		i += 1
		continue
	j = 2 * i
	while j < N:
		sieve[j] = 0
		j += i
	i += 1
for i in range(4, N):
	if sieve[i] != 1 and sieve[N - i] != 1:
		print(i, N - i)
		break


n = int(input())
if n % 2 == 0:
	s = [6, n - 6]
else:
	s = [9, n - 9]
for x in s:
	print(x, end=' ')


n = int(input())

def prime(num):
	for i in range(2, num):
		if num % i == 0:
			return False
			break
	else:
		return True
lst = list(range(1, n + 1, 1))
for i in range(3, len(lst) - 1, 1):
	r = prime(lst[i])
	if not r:
		r = prime(n - lst[i])
		if not r:
			print(lst[i], n - lst[i])
			break


comp = [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50]
n = int(input())

def is_prime(num):
	if num == 0 or num == 1:
		return False
	for x in range(2, num):
		if num % x == 0:
			return False
	else:
		return True
for i in comp:
	if is_prime(n - i) == False:
		print(i, n - i)
		break


def mp():
	return map(int, input().split())

def it():
	return int(input())
n = it()
if n & 1:
	print(9, n - 9)
else:
	print(8, n - 8)


s = int(input())
if s == 15:
	print('6 9')
elif s % 2 == 0:
	print('4 ', str(s - 4))
else:
	print('9 ', str(s - 9))


n = int(input())
k = 4
if n % 2 == 0:
	print(n - 4, 4)
else:
	while k < n - 4:
		if (n - k) % 3 == 0:
			print(k, n - k)
			break
		k += 2


import math

def isComposite(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
for k in range(4, n):
	if isComposite(k) and isComposite(n - k):
		print(k, n - k)
		exit()


def is_simple(x):
	count = 0
	for i in range(2, x):
		if x % i == 0:
			count += 1
	if not count:
		return False
	return True
n = int(input())
for i in range(4, n):
	if is_simple(i) and is_simple(n - i):
		print(i, n - i)
		exit(0)


def isPrime(n):
	flag = 0
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			flag = 1
			break
	return [1, 0][flag == 0]
n = int(input())
for i in range(4, n // 2 + 1):
	if isPrime(i) and isPrime(n - i):
		print(i, n - i)
		break


def two_composites(n):
	if n % 2 == 0:
		print(8, n - 8)
	else:
		print(9, n - 9)
num = int(input())
two_composites(num)


n = int(input())
arr = [i for i in range(1, n + 1)]
d = {}
ans = []
limit = n

def calculate_prime_flag_for_each_number_upto_limit():
	prime_flag = [True] * limit
	prime_flag[0] = prime_flag[1] = False
	for i in range(2, limit):
		if prime_flag[i] == True:
			for j in range(i * i, limit, i):
				prime_flag[j] = False
	return prime_flag
primes = calculate_prime_flag_for_each_number_upto_limit()
primes[1] = True
primes[0] = True
for i in arr:
	if n - i in arr:
		if primes[n - i] == False and primes[i] == False:
			print(n - i, i)
			break
	else:
		d[i] = 1


n = int(input())
print(*[[9, n - 9], [8, n - 8]][not n & 1])


n = int(input())
import math

def prime(n):
	prime = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			prime = 1
	return prime
for i in range(n):
	if prime(i) == 1 and prime(n - i) == 1:
		print(i, n - i)
		break


def checkprime(n):
	ans = True
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			ans = False
			break
	return ans
n = int(input())
for i in range(3, n):
	num1 = n - i
	if checkprime(num1) == False and checkprime(i) == False:
		print(num1, i)
		break


n = int(input())
if n % 2 == 0:
	print(6, n - 6)
else:
	print(9, n - 9)


def prime(num):
	a = [2, 3, 5, 7]
	if num in a:
		return True
	else:
		for i in a:
			if num % i == 0:
				return False
	return True
x = int(input())
(d, m) = divmod(x, 2)
m += d
i = 1
while prime(d) or prime(m):
	d -= i
	m += i
print('{} {}'.format(d, m))


n = int(input())
ans = 0
if n % 2 == 0:
	k = n // 2 - 1
	g = n // 2 + 1
else:
	k = n // 2 - 0
	g = n // 2 + 1
i_k = 0
i_g = 0
while ans != n:
	if k % 1 == 0:
		i_k += 1
	if k % 2 == 0:
		i_k += 1
	if k % 3 == 0:
		i_k += 1
	if k % 4 == 0:
		i_k += 1
	if k % 5 == 0:
		i_k += 1
	if k % 6 == 0:
		i_k += 1
	if k % 7 == 0:
		i_k += 1
	if k % 8 == 0:
		i_k += 1
	if k % 9 == 0:
		i_k += 1
	if g % 1 == 0:
		i_g += 1
	if g % 2 == 0:
		i_g += 1
	if g % 3 == 0:
		i_g += 1
	if g % 4 == 0:
		i_g += 1
	if g % 5 == 0:
		i_g += 1
	if g % 6 == 0:
		i_g += 1
	if g % 7 == 0:
		i_g += 1
	if g % 8 == 0:
		i_g += 1
	if g % 9 == 0:
		i_g += 1
	if i_k > 2 and i_g > 2:
		break
	else:
		k -= 1
		g += 1
	i_g = 0
	i_k = 0
print(k, g)


n = int(input())
if n % 2 == 0:
	a = [4, n - 4]
	for i in a:
		print(i, end=' ')
else:
	b = [9, n - 9]
	for i in b:
		print(i, end=' ')


def isPrimes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = True
	prime[1] = True
	prime[2] = True
	return prime
n = int(input())
primes = isPrimes(n)
i = n - 1
j = 0
if n % 2 == 0 and (not primes[n // 2]):
	print(n // 2, n // 2)
else:
	while True:
		if primes[j]:
			j += 1
		elif primes[i]:
			i -= 1
		elif i + j > n:
			i -= 1
		elif i + j < n:
			j += 1
		else:
			break
	print(i, j)


def isprime(x):
	f = True
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			f = False
			break
	return f

def gal(n):
	for i in range(2, n + 1):
		if isprime(i):
			continue
		if not isprime(n - i):
			print(i, n - i)
			break
a = int(input())
gal(a)


target = int(input())
first = 0
second = 0
numFound = False
for i in range(4, target):
	if first == 0 and second == 0:
		for j in range(2, i):
			if i % j == 0:
				first = i
				second = target - first
				break
	if first != 0 and (not numFound):
		for k in range(2, second):
			if second % k == 0:
				numFound = True
				break
			if second % k != 0 and k == second - 1:
				first = 0
				second = 0
print(first, second)


n = int(input())
if n % 2 == 0:
	if n - 8 >= 4:
		print(8, n - 8, sep=' ')
elif n - 9 >= 4:
	print(9, n - 9, sep=' ')


import math

def prime(num):
	for i in range(2, int(math.sqrt(num) + 1)):
		if num % i == 0:
			return False
	return True
n = int(input())
x = n // 2
y = n - x
while prime(x) or prime(y):
	x = x - 1
	y = y + 1
print(x, y)


import math

def ispr(a):
	for i in range(2, math.floor(a ** 0.5) + 1):
		if a % i == 0:
			return False
	return True
n = int(input())
m = n // 2
while 1:
	if not ispr(m) and (not ispr(n - m)):
		print(str(m) + ' ' + str(n - m))
		break
	else:
		m += 1


def is_prime(num):
	div = 2
	while div * div <= num:
		if num % div != 0:
			div += 1
		else:
			return False
	return True
n = int(input())
first = 4
second = n - 4
while is_prime(first) or is_prime(second):
	first += 1
	second -= 1
print(first, second)


import math

def is_prime(n):
	if n <= 1:
		return False
	if n == 2:
		return True
	if n % 2 == 0:
		return False
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	sub = 4
	while is_prime(n - sub):
		sub += 2
	print(sub, n - sub)


n = int(input())
i = 4
while i < n:
	a = i
	b = n - a
	primea = ''
	primeb = ''
	for k in range(2, a):
		if a % k == 0:
			primea = 'n'
	for l in range(2, b):
		if b % l == 0:
			primeb = 'n'
	i += 1
	if primea == 'n' and primeb == 'n':
		print(a, b)
		break


import math

def is_comp(val):
	for i in range(2, int(val ** 0.5) + 1):
		if val % i == 0:
			return True
	return False
n = int(input())
fir = n // 2
sec = n // 2 + n % 2
while not is_comp(fir) or not is_comp(sec):
	fir -= 1
	sec += 1
print(str(fir) + ' ' + str(sec))


a = int(input())
c = 0
for i in range(4, a + 1):
	if i % 2 == 0:
		if (a - i) % 2 == 0 or (a - i) % 3 == 0:
			print(i, a - i)
			break


n = int(input())
if n >= 12:
	if n % 2 == 0:
		print(8, n - 8)
	else:
		print(9, n - 9)


def criba_eratostenes(n):
	A = []
	multiplos = set()
	for i in range(2, n + 1):
		if i not in multiplos:
			A.append(i)
			multiplos.update(range(i * i, n + 1, i))
	return A
n = int(input())
C = criba_eratostenes(n)
a = 0
b = 0
k = 4
while k < n:
	if k not in C:
		if n - k not in C:
			a = k
			b = n - k
			k = n
		else:
			k += 1
	else:
		k += 1
print(str(a) + ' ' + str(b))


n = int(input())
if n % 2 == 0:
	print(' '.join([str(n - 4), '4']))
else:
	print(' '.join([str(n - 9), '9']))


from math import *

def isprime(num):
	if num == 2:
		return True
	if num == 1:
		return False
	if num % 2 == 0:
		return False
	for x in range(3, int(sqrt(num)) + 1, 2):
		if num % x == 0:
			return False
	return True
n = int(input())
if n % 2 == 0 and n // 2 % 2 == 0:
	print(n // 2, n // 2)
elif n % 2 == 0:
	print(n // 2 - 1, n // 2 + 1)
elif (n - 1) // 2 % 2 == 0:
	a = (n - 1) // 2
	b = n - (n - 1) // 2
	while isprime(b):
		b += 2
		a -= 2
	print(a, b)
else:
	a = (n - 1) // 2
	b = n - (n - 1) // 2
	while True:
		if not isprime(a):
			break
		b -= 2
		a += 2
	print(a, b)


n = int(input())

def f(x):
	for i in range(2, int(x ** (1 / 2)) + 1):
		if x % i == 0:
			return 1
	return 0
for i in range(n):
	if f(i) and f(n - i):
		print(i, n - i)
		break


n = int(input())
s = 0
for i in range(4, n, 2):
	t = n - i
	for j in range(2, t):
		if t % j == 0:
			print(i, t)
			s = 1
			break
		else:
			continue
	if s == 1:
		break
	else:
		continue


def isprime(n):
	flag = True
	if n == 1:
		return True
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			flag = False
			break
	return flag
n = int(input())
for i in range(2, n):
	if not isprime(i):
		if not isprime(n - i):
			break
print(i, ' ', n - i)


n = int(input())

def prime(n):
	for d in range(2, int(n ** (1 / 2)) + 1):
		if n % d == 0:
			return True
	return False
for i in range(4, n):
	if prime(n - i) and prime(i):
		print(i, n - i)
		break


def post(a):
	i = 2
	while i <= a ** (1 / 2) + 1:
		if a % i == 0:
			return 1
		i = i + 1
	return 0
n = int(input())
if n % 2 == 0:
	a = n // 2
	b = n // 2
else:
	a = n // 2
	b = n // 2 + 1
c = 0
d = 0
while c == 0:
	if post(a) == 0 or post(b) == 0:
		a = a - 1
		b = b + 1
	else:
		c = 1
print(a, b)


def dely(x):
	c = []
	i = 1
	while i <= x // 2:
		if x % i == 0:
			c.append(i)
		i += 1
	return c
e = []
e = 0
s = 0
n = int(input())
for j in range(5, n):
	if len(dely(j)) > 1 and len(dely(n - j)) > 1:
		s = n - j
		print(s, n - s)
		break


n = int(input())
u = int(n / 2)
v = int(n / 3)
if n % 2 == 0:
	print(n - 6, 6)
elif n % 3 == 0:
	r = int(n / 3)
	print(3 * (r - 2), 3 * 2)
else:
	print(n - 9, 9)


def com(num):
	bo = False
	for i in range(num - 2):
		if num % (i + 2) == 0:
			bo = True
	return bo
n = int(input())
for i in range(n):
	if com(i + 4) and com(n - i - 4):
		print(i + 4, end=' ')
		print(n - i - 4)
		break


a = int(input())
b = a % 2 * 5 + 4
print(b, a - b)


def notprime(a):
	count = 0
	for i in range(2, a):
		if a % i == 0:
			count += 1
			return True
	return False
a = int(input())
for i in range(4, a):
	j = a - i
	if notprime(i) and notprime(j) and (i + j == a):
		break
print(str(i) + ' ' + str(j))


def isPrime(n):
	if n == 1:
		return True
	elif n == 2:
		return True
	elif n & 1:
		for i in range(2, int(n ** (1 / 2)) + 1):
			if n % i == 0:
				return False
		return True
	return False
n = int(input())
x = 4
while True:
	if isPrime(n - x):
		x += 2
	else:
		print(x, n - x)
		break


from math import sqrt

def isnotPrime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
a = n // 2
while True:
	if isnotPrime(a) and isnotPrime(n - a):
		break
	else:
		a -= 1
print(a, n - a)


n = int(input())

def sostav(x):
	res = False
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			res = True
			break
	return res
for i in range(2, n // 2 + 1):
	if sostav(i) and sostav(n - i):
		print(i, n - i)
		break


import math

def is_prime(n):
	if n % 2 == 0 and n > 2:
		return False
	return all((n % i for i in range(3, int(math.sqrt(n)) + 1, 2)))
n = int(input())
for i in range(4, n - 3):
	if not is_prime(i) and (not is_prime(n - i)):
		print(str(i) + ' ' + str(n - i))
		break


n = int(input())
x = 0
y = 0
if n % 2 == 0:
	if n >= 8:
		x = 4
		y = n - 4
elif n >= 13:
	x = 9
	y = n - 9
print(x, y)


import math

def prime(n):
	if n < 2:
		return False
	if n == 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
x = 4
y = n - 4
while n > 12:
	if prime(x) == True or prime(y) == True:
		x = x + 2
		y = n - x
	else:
		break
print(x, y)


def prime(n):
	for i in range(2, int(n / 2) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
temp = int(n / 2)
for i in range(4, temp + 1):
	res1 = prime(i)
	res2 = prime(n - i)
	if res1 == True and res2 == True:
		print(i, end=' ')
		print(n - i)
		break


import sys
n = int(input())
examples = [4, 6, 8, 9]
simples = [2, 3, 5, 7]
stop = False
for number_1 in examples:
	for simple_number in simples:
		diff = n - number_1
		if diff % simple_number == 0 and diff // simple_number > 1:
			answer = str(number_1) + ' ' + str(diff)
			stop = True
			break
	if stop:
		break
print(answer)


def is_composite(num_):
	for i in range(2, num_ // 2 + 1):
		if num_ % i == 0:
			return True
	return False
data = int(input())
for num in range(4, data):
	if is_composite(num):
		if is_composite(data - num):
			print(num, data - num)
			break


n = int(input())
p = n % 2 + 8
q = n - p
print(str(p) + ' ' + str(q))


def vse_deliteli(n):
	k = 0
	for i in range(1, n + 1):
		if n % i == 0:
			k += 1
	return k
n = int(input())
if n >= 12:
	for i in range(4, n - 3):
		if vse_deliteli(i) > 2:
			if vse_deliteli(n - i) > 2:
				print(i, n - i)
				break


inputNumber = int(input())
if inputNumber % 2 == 0:
	C2 = inputNumber - 8
elif inputNumber % 2 == 1:
	C2 = inputNumber - 9
print(inputNumber - C2, C2)


def not_simple(x):
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			return True
	return False
n = int(input())
x = n - 4
for i in range(4, x):
	if not_simple(x) and not_simple(i) and (i + x == n):
		print(i, x)
		break
	x -= 1


n = int(input())
a = 8 + n % 2
print(a, n - a)


x = int(input())
import math

def isprime(n):
	i = 2
	while 1:
		if n % i == 0:
			return False
		if i >= math.sqrt(n):
			return True
		i += 1

def test(a):
	if a == 15:
		print('6 9')
		return
	c = a
	e = 0
	while 1:
		c -= 4
		e += 1
		r = not isprime(a - 4 * e)
		if r:
			print(c, a - c)
			return
test(x)


def f(a):
	d = 2
	while d * d <= a:
		if a % d == 0:
			break
		d += 1
	if d * d > a or a == 1:
		return True
	return False
n = int(input())
l = n // 2
r = n - l
a = f(l) and f(r)
while (f(l) or f(r)) == True:
	l -= 1
	r += 1
print(l, r)


import sys
import math
n = int(sys.stdin.readline().split()[0])

def is_simple(a):
	if a == 2:
		return True
	if a == 1 or a % 2 == 0:
		return False
	else:
		i = 3
		while i <= math.sqrt(a):
			if a % i == 0:
				return False
			i += 2
	return True
if n % 2 == 0:
	print('%d %d' % (4, n - 4))
else:
	x = 2
	y = n - x
	while is_simple(x) or is_simple(y):
		x += 1
		y = n - x
	print('%d %d' % (x, y))


n = int(input())
x = 0
for i in range(2, 11):
	if (n - 4) % i == 0:
		x = n - 4
	elif (n - 6) % i == 0:
		x = n - 6
	elif (n - 8) % i == 0:
		x = n - 8
print(x, n - x)


import math
import random

def prime(n):
	flag = 1
	sq = random.randint(4, n)
	for i in range(2, sq):
		if n % i == 0:
			flag = 0
			break
	return flag
n = int(input())
k = int(n / 2)
m = 0
while 1:
	m = n - k
	if prime(m) == 1 or prime(k) == 1:
		k -= 1
	else:
		break
print(m, k)


n = int(input())
if n & 1 == 1:
	print(9, n - 9)
else:
	print(8, n - 8)


n = float(input())

def test(n, i=0, flag=0):
	for i in range(2, int(n ** 0.5) + 1):
		if n / i == int(n / i):
			flag = 1
			break
	return flag
if n % 4 == 0:
	print(int(n / 2), int(n / 2))
elif n % 4 != 0 and n % 2 != 0:
	for j in range(9, int(n + 1)):
		if test(j) and n - j != 2:
			print(j, int(n - j))
			break
		else:
			j += 1
elif n % 4 != 0 and n % 2 == 0:
	for j in range(4, int((n + 1) / 2) + 2):
		if test(j) and test(n - j):
			print(j, int(n - j))
			break


def is_prime(a):
	if a < 2:
		return False
	for x in range(2, int(a ** 0.5) + 1):
		if a % x == 0:
			return False
	return True
n = int(input())
i = 4
while is_prime(n - i):
	i += 2
print(n - i, i)


def simplicity_check(x):
	for i in range(2, int(x ** (1 / 2)) + 1):
		if x % i == 0:
			return 0
	return 1
n = int(input())
if n % 2 == 0:
	if simplicity_check(n // 2) == 1:
		print(n // 2 - 1, n // 2 + 1)
	else:
		print(n // 2, n // 2)
else:
	a = n // 2
	b = n // 2 + 1
	while not (simplicity_check(a) == 0 and simplicity_check(b) == 0):
		a -= 1
		b += 1
	print(a, b)


def isprime(n):
	den = 0
	for i in range(1, n + 1):
		if n % i == 0:
			den += 1
	if den == 2:
		return True
	elif den > 2:
		return False

def check(n, a):
	b = n - a
	if not isprime(a) and (not isprime(b)):
		return [a, b]
	else:
		return check(n, a + 2)
n = int(input())
l = check(n, 4)
print(l[0], l[1])


in0 = int(input())
(in1, in2) = (0, 0)
if in0 % 2 == 0:
	(in1, in2) = (in0 // 2, in0 // 2)
	for x in range(100):
		if in1 % 2 == 0 or in1 % 3 == 0:
			if in2 % 2 == 0 or in2 % 3 == 0:
				print(in1, in2)
				break
			else:
				in1 -= 1
				in2 += 1
		else:
			in1 -= 1
			in2 += 1
else:
	(in1, in2) = ((in0 + 1) // 2, (in0 + 1) // 2)
	in1 -= 1
	for x in range(100):
		if in1 % 3 == 0 or in1 % 2 == 0:
			if in2 % 3 == 0 or in2 % 2 == 0:
				print(in1, in2)
				break
			else:
				in1 -= 1
				in2 += 1
		else:
			in1 -= 1
			in2 += 1


def is_composite(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n // 2 + 1):
	if is_composite(i) and is_composite(n - i):
		print(i, n - i)
		break


n = int(input())
if n % 2:
	for m in [4, 6, 8]:
		if not (n - m) % 3:
			print(m, n - m)
else:
	print(n // 4 * 2, n - n // 4 * 2)


a = int(input())

def prime(a):
	p = 2
	if a == 2:
		return True
	elif a % 2 == 0:
		return False
	else:
		if a == 1:
			return False
		elif a % 2 == 0:
			return False
		elif a == 2 or a == 3:
			return True
		for i in range(3, int(a ** (1 / 2)) + 2):
			if a % i == 0:
				p = 0
				break
			else:
				p = 1
		if p == 1:
			return True
		elif p == 0:
			return False
c = a - 2
d = a // 2 + 1
l = []
for j in range(2, a):
	b = a - j
	if prime(b) != True and prime(j) != True:
		l.append(b)
		l.append(j)
		break
s = str(l[0]) + ' ' + str(l[1])
print(s)


def prime(x):
	for i in range(2, x):
		if x % i == 0:
			return 1
x = int(input())
m = 4
n = x - m
while prime(m) != 1 or prime(n) != 1:
	m += 1
	n = x - m
print(m, n)


n = int(input().strip())

def is_composite(number):
	if number == 2:
		return True
	for i in range(2, int(number ** 0.5 + 0.5) + 1):
		if number % i == 0:
			return True
	return False
for i in range(4, n - 3):
	if is_composite(i) and is_composite(n - i):
		print('{} {}'.format(i, n - i))
		break


n = int(input())
d = {2: [4, 8], 3: [4, 9], 4: [4, 10], 5: [6, 9], 6: [6, 10], 7: [8, 9], 8: [8, 10], 9: [10, 9], 0: [10, 10], 1: [12, 9]}
(a, r) = divmod(n, 10)
print(f'{n - d[r][1]} {d[r][1]}')


n = int(input())
if n % 2:
	print(' '.join(list(map(str, sorted([9, n - 9])))))
else:
	print(' '.join(list(map(str, sorted([8, n - 8])))))


import random

def comp(t):
	for i in range(2, t):
		if t % i == 0:
			return True
	return False

def my_print(t):
	x = random.randint(2, t - 1)
	y = t - x
	if comp(x) and comp(y):
		print(x, y)
	else:
		my_print(t)
n = int(input())
start = 12
end = 10 ** 6 + 1
if n in range(start, end):
	my_print(n)


def isNotPrime(n):
	if n == 2 or n == 3:
		return False
	else:
		x = n ** 0.5
		for i in range(2, n):
			if n % i == 0:
				return True
		return False
n = int(input())
for i in range(4, n - 3):
	if isNotPrime(i) and isNotPrime(n - i):
		print(i, n - i)
		break


n = int(input())
for i in range(2, 5):
	x = 2 * i
	if (n - x) % 3 == 0:
		break
print(x, n - x)


m = int(input())
if m % 2 == 0:
	print(4, m - 4)
else:
	print(9, m - 9)


n = int(input())
print(['4 ' + str(n - 4), '9 ' + str(n - 9)][n % 2])


def isPrime(n):
	if n <= 2:
		return True
	if n % 2 == 0:
		return False
	k = 3
	while k * k <= n:
		if n % k == 0:
			return False
		k += 2
	return True
n = int(input())
a = n // 2
b = n - a
if not isPrime(a) and (not isPrime(b)):
	print(min(a, b), max(a, b))
else:
	while isPrime(a) or isPrime(b):
		a -= 1
		b += 1
	print(min(a, b), max(a, b))


a = int(input())
mul = []

def prime(n):
	mul2 = []
	for i in range(2, 11):
		if n % i == 0:
			mul2.append(i)
	if n in mul2:
		mul2.remove(n)
	if len(mul2) > 0:
		return False
	else:
		return True
for i in range(1, a):
	if not prime(i) and (not prime(a - i)) and (i != 2) and (a - i != 2):
		print(i, a - i)
		break


x = int(input())
for i in range(4, x - 1):
	k = 0
	t = x - i
	k1 = 0
	for j in range(2, i):
		if i % j == 0:
			k = 1
			break
	for j1 in range(2, x - i):
		if t % j1 == 0:
			k1 = 1
			break
	if k == 1 and k1 == 1:
		print(i, x - i)
		break
	else:
		continue


def main():

	def prime(n):
		for i in range(2, n // 2 + 1):
			if n % i == 0:
				return True
		return False
	n = int(input())
	for i in range(n // 2, 3, -1):
		if prime(i) and prime(n - i):
			print(i, n - i)
			return
main()


def sieve(arr):
	arr[0] = 1
	arr[1] = 1
	for i in range(2, 1001):
		if arr[i] == 0:
			for j in range(i * i, 1000001, i):
				arr[j] = 1
	return arr
arr = [0 for i in range(1000002)]
arr = sieve(arr)
n = int(input())
for i in range(4, n + 1):
	if arr[i] == 1 and arr[n - i] == 1:
		print(i, n - i)
		break


n = int(input())
if n % 2 == 1:
	a = n - 9
	b = 9
else:
	a = n - 8
	b = 8
print(a, b)


n = int(input())
if n % 2 == 0:
	c = n / 2
	if c % 2 == 0 or c % 3 == 0:
		print('%d %d' % (c, c))
	else:
		print('%d %d' % (c - 1, c + 1))
elif n % 3 == 0 and n % 2 != 0:
	c = n / 3
	print('6 %d' % (n - 6))
elif n % 3 == 2 and n % 2 != 0:
	print('8 %d' % (n - 8))
elif n % 3 == 1 and n % 2 != 0:
	print('4 %d' % (n - 4))


n = int(input())
q = n - 12
x = 4 + (q if q % 2 == 0 else q - 1)
print(x, n - x)


def is_prime(n):
	if n in [2, 3, 5, 7]:
		return True
	if n % 2 == 0:
		return False
	r = 3
	while r * r <= n:
		if n % r == 0:
			return False
		r += 2
	return True
n = int(input())
for i in range(2, n):
	if not is_prime(i) and (not is_prime(n - i)):
		print(i, ' ', n - i)
		break


(n, n1) = (int(input()) - 4, 4)
while n % 2 > 0 or n1 % 3 > 0:
	n -= 1
	n1 += 1
print(n, ' ', n1)


import math

def isPrime(i):
	lastNum = int(math.ceil(math.sqrt(i)))
	for j in range(2, lastNum + 1):
		if i % j == 0:
			return False
	return True
target = int(input())
(x, y) = (int(math.floor(target / 2)), int(math.ceil(target / 2)))
while isPrime(x) or isPrime(y):
	x += 1
	y -= 1
print(str(x) + ' ' + str(y))


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
value = int(f_input())
if value % 2 == 0:
	f_print(str(value - 6) + ' 6')
else:
	f_print(str(value - 9) + ' 9')


def isprime(n):
	f = 0
	for i in range(2, n):
		if n % i == 0:
			f = 1
			break
	if f == 1:
		return -1
	else:
		return 1
n = int(input())
f = 1
a = 4
b = n - 4
while f == 1:
	if isprime(a) == 1 or isprime(b) == 1:
		a += 1
		b -= 1
	else:
		f = 0
print(a, b)


def isPrime(n):
	if n % 2 == 0:
		return n == 2
	d = 3
	while d * d <= n and n % d != 0:
		d += 2
	return d * d > n
n = int(input())
s1 = n // 3
s2 = n // 2 + 2
for i in range(s1, s2):
	if not isPrime(i) and (not isPrime(n - i)):
		print(i, n - i)
		break


number = int(input())
half = number // 2
while (half + 1) % 6 == 0 or (half - 1) % 6 == 0 or (number - half + 1) % 6 == 0 or ((number - half - 1) % 6 == 0):
	half -= 1
print(half, number - half)


from sys import stdin

def isPrime(x):
	if x <= 2:
		return True
	elif not x % 2:
		return False
	else:
		for y in range(3, int(x ** 0.5) + 1, 2):
			if not x % y:
				return False
	return True
n = int(stdin.readline().rstrip())
i = n - 2
while i > 1:
	if not isPrime(i) and (not isPrime(n - i)):
		print(i, n - i)
		break
	i -= 1


num = int(input())
for f in range(4, num):
	num % f == 0
	a = f
	b = num - f
	aa = 0
	bb = 0
	for f1 in range(2, a):
		if a % f1 == 0:
			aa = 1
			break
	for f2 in range(2, b):
		if b % f2 == 0:
			bb = 1
			break
	if aa + bb == 2:
		print(a, b)
		break


m = int(input())
x = 0
y = 0

def IsPrime(n):
	if n == 1:
		return False
	elif n == 2:
		return True
	else:
		for x in range(2, n):
			if n % x == 0:
				return False
		return True
for i in range(3, m):
	if IsPrime(i) == False:
		x = i
		y = m - x
		if IsPrime(y) == False:
			print(x, y)
			break


n = int(input())
if n == 12:
	print('6 6')
elif (n - 10) % 2 == 0:
	print('10', n - 10)
else:
	print('9', n - 9)


n = int(input())
a = 4
b = n - 4
cond = 0
while True:
	cond = 0
	for i in range(2, a):
		if a % i == 0:
			cond += 1
			break
	for i in range(2, b):
		if b % i == 0:
			cond += 1
			break
	if cond == 2:
		break
	else:
		a += 1
		b -= 1
print(a, b)


liczba = int(input())
if liczba % 2:
	print(9, liczba - 9)
else:
	print(4, liczba - 4)


def SieveOfEratosthenes(n, prime, P):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, n + 1):
		if prime[p] == False:
			P += [p]
n = int(input())
s = [True] * (n + 1)
P = []
SieveOfEratosthenes(n, s, P)
for i in P:
	if n - i in P:
		print(i, n - i)
		break
	else:
		continue


n = int(input())
if n % 4 == 0:
	print(int(n / 2), int(n / 2), sep=' ')
elif n % 4 == 2:
	print(2 * (n // 4), 2 * (n // 4) + 2, sep=' ')
elif n % 8 == 1:
	if n == 17:
		print(9, 8, sep=' ')
	else:
		k = n // 8
		print(6 * k + 3, 2 * k - 2, sep=' ')
elif n % 8 == 3:
	k = n // 8
	print(5 * k, 3 * k + 3, sep=' ')
elif n % 8 == 5:
	if n == 13:
		print(9, 4, sep=' ')
	else:
		k = n // 8
		print(5 * k + 5, 3 * k, sep=' ')
else:
	k = n // 8
	print(6 * k + 3, 2 * k + 4, sep=' ')


n = int(input())
if n % 2 == 0:
	k = n - 8
	print(k, 8)
else:
	k = n - 9
	print(9, k)


import math
n = int(input())
sqrt = math.sqrt

def isPrime(a):
	if a < 2:
		return False
	for i in range(2, a):
		if a % i == 0:
			return False
	return True
for i in range(4, n - 1):
	if isPrime(i) == False:
		a = i
		b = n - i
		if isPrime(b) == False:
			break
		else:
			continue
print(a, b)


import sys

def notPrime(a):
	for i in range(2, a):
		if a % i == 0:
			return a
	return 0
n = int(input())
for y in range(4, n):
	Y = notPrime(y)
	X = notPrime(n - Y)
	if Y and X:
		print(Y, end=' ')
		print(X)
		sys.exit()


n = int(input())
if (n - 4) % 2 == 0 or (n - 4) % 3 == 0 or (n - 4) % 5 == 0 or ((n - 4) % 7 == 0):
	print('4', n - 4)
elif (n - 6) % 2 == 0 or (n - 6) % 3 == 0 or (n - 6) % 5 == 0:
	print('6', n - 6)
elif (n - 8) % 2 == 0 or (n - 8) % 3 == 0:
	print('8', n - 8)


n = int(input())
if n % 2 == 0:
	p = 4
	k = n - p
	print(p, k)
else:
	p = 9
	k = n - p
	print(p, k)


n = int(input())
if n <= 5:
	print('Number Must Be Greater Than 5')
elif n % 2 != 0:
	print('9', n - 9)
elif n % 2 == 0:
	print('4', n - 4)


def a(n, prime):
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
s = [True] * (10 ** 6 + 1)
a(10 ** 6, s)
z = int(input())
for i in range(z):
	if s[i] == False and s[z - i] == False:
		print(i, z - i)
		break


n = 1000001
num = [True] * n

def prime():
	for i in range(2 * 2, n, 2):
		num[i] = False
	i = 3
	while i * i <= n:
		if num[i] == True:
			for j in range(i * i, n, i):
				num[j] = False
		i += 2
	return
prime()
x = int(input())
n = x // 2
while num[n] == True or num[x - n] == True:
	n -= 1
print(n, x - n)


a = int(input())
if a & 1:
	print(a - 9, 9)
else:
	print(a - 8, 8)


from sys import stdin
_input = stdin.readline
(_range, _int) = (range, int)
from math import sqrt

def solution():

	def is_not_simple(d):
		for i in _range(2, _int(sqrt(d)) + 1):
			if d % i == 0:
				return True
		return False
	n = _int(_input())
	for i in _range(4, n):
		if i % 2 == 0 and is_not_simple(n - i):
			print(i, n - i)
			break
solution()


def isPrime(n):
	if n <= 1:
		return False
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n - 3):
	if not (isPrime(i) or isPrime(n - i)):
		print('{} {}'.format(i, n - i))
		break


import math
n = int(input())

def primenumber(pom):
	for j in range(2, int(math.sqrt(pom)) + 1):
		if pom % j == 0:
			return True
	return False
for i in range(4, n, 2):
	pom = n - i
	if primenumber(pom):
		print(pom, i)
		break


n = int(input())
if n % 2 == 0:
	print(n - 4, 4)
else:
	if n % 6 == 1:
		print(9, n - 9)
	if n % 6 == 3:
		print(6, n - 6)
	if n % 6 == 5:
		print(8, n - 8)


n = int(input())
res = 9
lres = 4
if n % 2 == 0:
	temp = n / 2
	if temp % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		print(lres, n - lres)
else:
	print(res, n - res)


primes = []
composites = []

def make_seive(N):
	global primes
	global composites
	primes = []
	composites = []
	seive = [True] * (N + 1)
	for i in range(2, N + 1):
		if seive[i]:
			primes.append(i)
		else:
			composites.append(i)
			continue
		for j in range(2 * i, N + 1, i):
			seive[j] = False
N = int(input())
make_seive(N)
for num in composites:
	if N - num in composites:
		print(num, N - num)
		break


import sys
l = int(input())

def check(n):
	c = 0
	p = 0
	for i in range(2, n):
		if n % i == 0:
			c = c + 1
		else:
			p = p + 1
	if c > 0:
		return True
	else:
		return False
for i in range(2, int(l)):
	if check(i) and check(l - i):
		print(i)
		print(l - i)
		sys.exit()


def isPrime(angka):
	if angka <= 1:
		return False
	if angka <= 3:
		return True
	if angka % 2 == 0 or angka % 3 == 0:
		return False
	i = 5
	while i * i <= angka:
		if angka % i == 0 or angka % (i + 2) == 0:
			return False
		i = i + 6
	return True

def proses_akhir():
	for k in range(4, n + 1):
		o = n - k
		for l in range(o, o + 1):
			if isPrime(k):
				break
			if isPrime(l):
				break
			if k + l == n:
				return '{} {}'.format(k, l)
jangkauan_angka = []
for j in range(12, 10 ** 6 + 1):
	jangkauan_angka.append(j)
n = int(input())
print(proses_akhir())


n = int(input())
if n % 2 == 0:
	if n // 2 % 2 == 1:
		print(n // 2 + 1, n // 2 - 1)
	else:
		print(n // 2, n // 2)
else:
	i = (n - 1) // 2
	j = (n + 1) // 2
	if i % 2 == 1:
		while i % 3 != 0:
			i += 2
			j -= 2
	else:
		while j % 3 != 0:
			j += 2
			i -= 2
	print(i, j)


n = int(input())
n1 = 0
n2 = 0
for x in range(n):
	n1 = x
	n2 = n - x
	count1 = 0
	for y in range(1, n1 + 1):
		if n1 % y == 0:
			count1 += 1
		if count1 > 2:
			break
	count2 = 0
	for z in range(1, n2 + 1):
		if n2 % z == 0:
			count2 += 1
		if count2 > 2:
			break
	if count1 > 2 and count2 > 2:
		break
print(n1, n2)


n = int(input())
li = []
for x in range(4, n):
	for y in range(4, n):
		if x + y == n and ((x % 2 == 0 or x % 3 == 0) and (y % 2 == 0 or y % 3 == 0)):
			li.append(x)
			li.append(y)
	if len(li) == 2:
		break
for k in li:
	print(k, end=' ')


n = int(input())
l = []
m = []
if n % 2 == 0:
	l.append('8')
	l.append(n - 8)
	print(*l)
else:
	m.append('9')
	m.append(n - 9)
	print(*m)


n = int(input())

def prime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
j = 2
while j < n:
	if not prime(j) and (not prime(n - j)):
		print(j, n - j)
		break
	j += 1


n = int(input())

def sos(x):
	s = 0
	for i in range(2, 10):
		if x % i == 0:
			s += 1
	return s
if n % 2 == 0:
	p = n // 2
	t = n // 2
else:
	p = n // 2
	t = n // 2 + 1
while sos(p) < 2 or sos(t) < 2:
	p -= 1
	t += 1
print(p, t)


n = int(input())
found = False

def isComposite(n):
	comp = False
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
start = 4
while not found:
	if isComposite(start) and isComposite(n - start):
		print(start, n - start)
		found = True
	else:
		start += 1


def isprime(x):
	if x == 1:
		return 0
	if x == 2:
		return 1
	i = 2
	while i * i <= x:
		if x % i == 0:
			return 0
		i += 1
	return 1
n = int(input())
for i in range(3, n // 2 + 1):
	if (1 - isprime(i)) * (1 - isprime(n - i)) == 1:
		print(str(i) + ' ' + str(n - i))
		break


from math import sqrt

def sieve(n):
	if n < 2:
		return
	sieve = [i for i in range(n)]
	sieve[1] = 0
	for i in range(2, int(sqrt(n)) + 1):
		if sieve[i]:
			for j in range(i * i, n, i):
				sieve[j] = 0
	return set((v for v in sieve if v))
n = int(input())
primes = sieve(n)
a = 4
b = n - a
while a in primes or b in primes:
	a += 1
	b = n - a
print(a, b)


def f():
	x = int(input())
	print('4', x - 4) if x % 2 == 0 else print('9', x - 9)
f()


from math import sqrt

def sieve(n):
	global prime
	l = n + 1
	prime = [False, False] + [True for i in range(2, l)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * p, l, p):
				prime[i] = False
		p += 1

def primes(n):
	return [i for (i, v) in enumerate(sieve(n)) if v]

def solve(n):
	global prime
	sieve(1000001)
	for i in range(4, n + 1):
		if not prime[i] and (not prime[n - i]):
			return (i, n - i)

def main():
	n = int(input())
	print(*solve(n))
main()


a = int(input())
if a % 3 == 0:
	print(6, a - 6)
if a % 3 == 1:
	print(4, a - 4)
if a % 3 == 2 and a > 14:
	print(8, a - 8)
if a == 14:
	print(6, 8)


import math
n = int(input())
for i in range(4, math.ceil(n / 2)):
	x = i
	y = n - i
	if x == 5 or x == 7:
		continue
	elif (x % 2 == 0 or x % 3 == 0 or x % 5 == 0 or (x % 7 == 0)) and (y % 2 == 0 or y % 3 == 0 or y % 5 == 0 or (y % 7 == 0)):
		print(x, y)
		break


m = int(input())
if m % 2 == 0:
	print(8, m - 8)
else:
	print(9, m - 9)


def check(num):
	for i in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]:
		if num % i == 0 and num // i > 1:
			return 1
	return 0
n = int(input())
j = 4
num = n - 4
while not check(num):
	j = j + 1
	if check(j):
		num = n - j
print(num, j)


n = int(input())
a = [0] * 1000002
a[0] = 2
a[1] = 2
for i in range(2, 1000001):
	if a[i] == 0:
		j = i * 2
		while j <= 1000001:
			a[j] = 1
			j = j + i
	elif a[i] == 1:
		if n - i <= i and a[n - i] == 1:
			print(i, n - i)
			break


def isPrime(k):
	for i in range(2, k):
		if k % i == 0:
			return 1
	return 0
n = int(input())
a = 4
b = n - 4
for i in range(1, n + 1):
	m = isPrime(a)
	n = isPrime(b)
	if n == 1 and m == 1:
		print(a, ' ', b)
		break
	a = a + 1
	b = b - 1


def isComp(n):
	if n == 1:
		return False
	elif n == 2:
		return False
	else:
		for x in range(2, n):
			if n % x == 0:
				return True
		return False
n = int(input())
saver = 0
saver2 = 0
for i in range(n):
	if isComp(i) == True and isComp(n - i) == True:
		saver = i
		saver2 = n - i
		break
print(str(saver) + ' ' + str(saver2))


def pricheck(a):
	i = 2
	while i < a // 2 + 1:
		if a % i == 0:
			return 1
		i += 1
	return 0
a = int(input())
i = 2
n = 0
while n == 0:
	c = i
	d = a - i
	i += 1
	n = pricheck(c) * pricheck(d)
print(c, d)


def isPrime(p):
	if p == 2:
		return True
	c = 1
	for j in range(p // 2 + 1):
		c = c * (p - j) // (j + 1)
		if c % p:
			return False
	return True
t = int(input())
x = round(t ** 0.5)
y = t - x
while isPrime(x) or isPrime(y):
	x += 1
	y -= 1
print(x, y)


import math
n = int(input())
d = 1
for i in range(2, int(math.sqrt(n)) + 1):
	if n % i == 0:
		d = i
		break
if d == 1:
	x = 3 if n % 3 == 0 else 2 if n % 3 == 1 else 4
	y = n - 2 * x
	print(2 * x, y)
else:
	print(n // d // 2 * d, (n // d - n // d // 2) * d)


import sys
if False:
	input = open('composites.txt', 'r')
else:
	input = sys.stdin
n = int(input.readline())
summand1 = []
summand2 = []
for i in range(4, n - 3):
	summand1.append(i)
	summand2.append(n - i)

def primecheck(number):
	for divisor in range(2, number):
		a = number % divisor
		if a == 0:
			return False
	return True
for x in range(len(summand1)):
	if primecheck(summand1[x]) == False:
		if primecheck(summand2[x]) == False:
			print(summand1[x], summand2[x])
			break


import sys
n = int(sys.stdin.readline())
if n % 2 == 0:
	ans = '4 ' + str(n - 4)
else:
	a = 4
	b = n - a
	while a % 2 != 0 and a % 3 != 0 or (b % 2 != 0 and b % 3 != 0):
		a = a + 1
		b = b - 1
	ans = str(a) + ' ' + str(b)
print(ans)


n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(2, 5):
		if (n - 2 * i) % 3 == 0:
			y = n - 2 * i
	print(n - y, y)


def findNums(n):
	if n <= 11:
		if n == 8:
			print('4 4', end=' ')
		if n == 10:
			print('4 6', end=' ')
		else:
			print('-1', end=' ')
	if n % 2 == 0:
		print('4 ', n - 4, end=' ')
	else:
		print('9 ', n - 9, end=' ')
n = int(input())
findNums(n)


from sys import stdin
N = int(stdin.readline())
if N % 2 == 0:
	print(4, N - 4)
else:
	print(9, N - 9)


n = int(input())
if n % 2 == 0:
	if n / 2 % 2 == 0:
		print(n // 2, n // 2, sep=' ')
	else:
		print(n // 2 - 1, n // 2 + 1, sep=' ')
else:
	print(9, n - 9, sep=' ')


N = int(input())
t = 2
k = 1
if N % 2 == 0:
	if int(N / 2) % 2 == 0 and int(N / 2) % 2 == 0:
		print(int(N / 2), int(N / 2))
	else:
		print(int(N / 2 - 1), int(N / 2 + 1))
elif N != 17 and N % 2 != 0:
	hasil1 = int(N / 2 - 1)
	hasil2 = int(N / 2 + 2)
	for i in range(int(N / 2)):
		if hasil1 % 2 == 0 and hasil2 % 2 == 0 or (hasil1 % 2 == 0 and hasil2 % 3 == 0):
			print(hasil1, hasil2)
			break
		else:
			hasil1 -= 1
			hasil2 += 1
elif N == 17:
	print(int(8), int(9))


import math as M
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	print(9, n - 9)


from math import sqrt
from itertools import count, islice

def is_prime(n):
	return n > 1 and all((n % i for i in islice(count(2), int(sqrt(n) - 1))))
n = int(input())
(n1, n2) = (n - int(n / 2), int(n / 2))
for i in range(100):
	if is_prime(n1):
		n1 -= 1
		n2 += 1
	if is_prime(n2):
		n2 += 1
		n1 -= 1
	if not is_prime(n1) and (not is_prime(n2)):
		print(n1, n2)
		exit()


n = int(input())
a = 1
b = n - 1
x = 1
while x == 1:
	a += 1
	b -= 1
	for i in range(2, a):
		for j in range(2, min(b, 50)):
			if a % i == 0 and b % j == 0:
				print(a, b)
				quit()


def main():
	num = int(input())
	if num % 2 == 0:
		print('4 ' + str(num - 4))
	else:
		print('9 ' + str(num - 9))
main()


def prime(x):
	for i in range(2, x):
		if x % i == 0:
			break
		else:
			continue
	if i == x - 1:
		return True
	else:
		return False
n = int(input())
x = n // 2
y = n - x
while True:
	if prime(x) or prime(y):
		x -= 1
		y += 1
		continue
	else:
		break
print(x, y)


def sloz(n):
	for i in range(2, n):
		if n % i == 0:
			return 1
	return 0
n = int(input())
for i in range(4, n - 3):
	if sloz(i) and sloz(n - i):
		print(i, n - i)
		break


def value():
	n = input()
	n = int(n)
	if n % 2 == 0:
		print(4, int(n - 4))
	else:
		print(9, int(n - 9))
value()


def resheto(j):
	from math import floor
	from math import sqrt
	if j == 1:
		return 0
	else:
		fl = 0
		for i in range(2, int(floor(sqrt(j)) + 1)):
			if j % i == 0:
				fl = 1
		if fl == 0:
			return 1
		else:
			return 0
n = int(input())
for i in range(2, n):
	if resheto(i) == 0 and resheto(n - i) == 0:
		print(i, n - i)
		break


import math

def gcd(a, b):
	if a % b == 0:
		return b
	else:
		return gcd(b, a % b)

def main():
	n = int(input())
	if n % 2 != 0:
		x = 9
		y = n - 9
	else:
		x = 8
		y = n - 8
	print(x, y)
main()


n = int(input())
a = 0
if n % 2 == 0:
	a = 4
else:
	a = 9
print(str(a) + ' ' + str(n - a))


n = int(input())

def is_composite(x):
	ans = False
	for i in range(2, x):
		if x == 2:
			ans = True
			return ans
		elif x % i == 0:
			ans = True
			return ans
	return ans
for i in range(n):
	if is_composite(i):
		y = n - i
		if is_composite(y):
			print(i, y)
			break


y = int(input())
x = y

def prime(s):
	n = 0
	for i in range(2, int(s ** 0.5) + 1):
		if s % i == 0:
			return 0
	return 1
n = 0
for i in range(3, x):
	for j in range(3, x):
		if i + j == x and prime(i) == 0 and (prime(j) == 0):
			print(i, j)
			n = 1
			break
	if n == 1:
		break


def prime(x):
	for i in range(2, x):
		if x % i != 0:
			a = True
		else:
			a = False
			break
	return a
n = int(input())
for i in range(n):
	a = 4 + i
	b = n - a
	if prime(a) == False and prime(b) == False:
		print(a, b)
		break


def is_composite(num):
	res = True
	for i in range(2, num):
		if num % i == 0:
			res = False
			break
	return not res
n = int(input())
a = 4
b = n - 4
for _ in range(n):
	if is_composite(a) and is_composite(b):
		print(f'{a} {b}')
		break
	else:
		a += 1
		b -= 1


n = int(input())
a = [True] * n
for i in range(2, n):
	if a[i]:
		for j in range(i + i, n, i):
			a[j] = False
for x in range(n - 3):
	if a[x]:
		continue
	y = n - x
	if not a[y]:
		print(x, y)
		exit()


def isPrime(n):
	if n == 2 or n == 3 or n == 5:
		return True
	if n % 2 == 0 or n % 3 == 0 or n % 5 == 0:
		return False
	for i in range(7, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
a = n // 2
b = n - a
while True:
	if isPrime(a):
		a -= 1
		b += 1
	elif isPrime(b):
		a -= 1
		b += 1
	else:
		break
print('{} {}'.format(a, b))


n = int(input())

def prime(x, y):
	if x % 6 == 1 or x % 6 == 5 or y % 6 == 1 or (y % 6 == 5):
		x = x + 1
		y = y - 1
		return prime(x, y)
	else:
		return (x, y)
if n % 2 == 0:
	(i, j) = (n // 2, n // 2)
	(p, q) = prime(i, j)
	print(p, q)
else:
	(i, j) = (n // 2 + 1, n // 2)
	(p, q) = prime(i, j)
	print(p, q)


from random import randint
from math import *

def estpremier(n):
	if n < 7:
		if n in (2, 3, 5):
			return True
		else:
			return False
	if n & 1 == 0:
		return False
	k = 3
	r = sqrt(n)
	while k <= r:
		if n % k == 0:
			return False
		k += 2
	return True
n = int(input())
a = 2
b = 2
while estpremier(a) or estpremier(b):
	a = randint(4, n - 4)
	b = n - a
print(str(a) + ' ' + str(b))


import math

def isComposite(number):
	test = 2
	while test <= math.ceil(math.sqrt(number)):
		if number % test == 0:
			return True
		test += 1
	return False
n = int(input())
condition = True
guess1 = math.floor(n / 2)
guess2 = n - guess1
while condition:
	if isComposite(guess1) and isComposite(guess2):
		condition = False
	else:
		guess1 -= 1
		guess2 += 1
print(guess1, guess2)


n = int(input())
a = 4

def noprime(x):
	if x % 2 == 0 and x != 2 or (x % 3 == 0 and x != 3) or (x % 5 == 0 and x != 5):
		return True
	else:
		return False
while not noprime(a) or not noprime(n - a):
	a += 1
print(a, n - a)


n = int(input())
m = n - 9
if m % 2 == 0:
	print(9, m)
else:
	print(8, m + 1)


import sys
n = int(sys.stdin.readline())
if n % 2 == 0:
	print(str(n - 4) + ' 4')
else:
	print('9 ' + str(n - 9))


import math
import sys
import re
n = int(input())
if n % 2 != 0:
	print(9, n - 9)
else:
	print(8, n - 8)


no = int(input())
if no % 2 == 0:
	print(no - 4, 4)
else:
	print(no - 9, 9)


__author__ = 'DeyerliQiz'

def primes_upto(limit):
	is_prime = [False] * 2 + [True] * (limit - 1)
	for n in range(int(limit ** 0.5 + 1.5)):
		if is_prime[n]:
			for i in range(n * n, limit + 1, n):
				is_prime[i] = False
	return [i for (i, prime) in enumerate(is_prime) if prime]
n = int(input())
prims = primes_upto(n)
for i in range(2, n - 1):
	if not i in prims and (not n - i in prims):
		print(i, n - i)
		break


n = int(input())
if n % 2 == 0:
	print('4', n - 4)
if n % 2 == 1:
	print('9', n - 9)


def prost(n):
	if n == 2:
		return 1
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return 0
	return 1
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(4, n):
		if not prost(i) and (not prost(n - i)):
			print(i, n - i)
			break


def isprime(x):
	for i in range(2, int(x ** 1 / 2) + 1):
		if x % i == 0:
			return False
	return True
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(4, n, 2):
		if isprime(n - i) == False:
			print(i, n - i)
			break


n = int(input())
print('6 ' + str(n - 6) if not n % 2 else '9 ' + str(n - 9))


def is_prime(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	else:
		return True
n = int(input())
for i in range(2, n):
	if not is_prime(i) and (not is_prime(n - i)):
		print(i, n - i)
		break


a = int(input())
if a % 2:
	print(9, a - 9)
elif a % 4:
	print(4, a - 4)
else:
	print(a // 2, a // 2)


def isPrime(num):
	for i in range(2, num // 2 + 1):
		if not num % i:
			return False
	return True
inp = int(input())
for j in range(inp // 2, 3, -1):
	if not isPrime(j):
		p = inp - j
		if not isPrime(p):
			print(j, p)
			break


def prime(n):
	flag = 1
	for i in range(2, n):
		if n % i == 0:
			flag = 0
			break
	return flag
n = int(input())
k = int(n / 2)
while True:
	m = n - k
	if prime(m) == 1 or prime(k) == 1:
		k = k - 1
	else:
		break
print(m, k)


def comp(a):
	c = 0
	for i in range(2, a):
		if a % i == 0:
			c += 1
	if c >= 1:
		return True
	else:
		return False
t = int(input())
for i in range(1, t + 1):
	j = t - i
	if comp(i) and comp(j):
		print(i, j)
		break


n = int(input())
if n == 8:
	print(4, 4)
elif n == 10:
	print(4, 6)
elif n % 2 != 0:
	print(9, n - 9)
elif n % 2 == 0:
	print(4, n - 4)


a = int(input())
if a % 4 == 0:
	print(a // 2, a // 2)
elif a % 4 == 2:
	print(a - 10, 10)
else:
	print(a - 9, 9)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
N = get_int()
if N % 2 == 0:
	print(4, N - 4)
else:
	print(9, N - 9)


n = int(input())
for i in range(4, n - 3):
	j = 2
	c = 0
	ct = 0
	while j <= i / 2:
		if i % j == 0:
			c = 1
			break
		j += 1
	if c == 1:
		if i * 2 == n:
			print('{} {}'.format(i, i))
			break
		j = 2
		while j <= (n - i) / 2:
			if (n - i) % j == 0:
				print('{} {}'.format(i, n - i))
				ct = 1
				break
			j += 1
	if ct == 1:
		break


n = int(input())

def sost(x):
	a = 2
	sos = 0
	while x > a:
		if x % a == 0:
			sos = 1
			break
		else:
			a = a + 1
	return sos
b = 4
while n > b:
	if sost(b) == 1:
		c = n - b
		if sost(c) == 1:
			print(b, c)
			break
		else:
			b = b + 1
	else:
		while sost(b) == 0:
			b = b + 1


def checkPrime(num):
	if num > 1:
		if num == int(4):
			return True
		for i in range(2, num // 2):
			if num % i == 0:
				return True
				break
		else:
			return False
	else:
		return True
num = int(input())
for i in range(3, num):
	if checkPrime(i):
		if checkPrime(num - i):
			print('%d %d' % (i, num - i))
			break


def isComposite(x):
	if x < 4:
		return False
	elif x % 2 == 0 or x % 3 == 0:
		return True
	for i in range(5, x, 6):
		if i ** 2 > x:
			break
		elif x % i == 0:
			return True
	return False
n = int(input())
for i in range(n - 1, 0, -1):
	if isComposite(i) is True and isComposite(n - i) is True:
		break
print(i, n - i)


t = int(input())
if t % 4 == 0:
	print(f'{t // 2} {t // 2}')
elif t % 2 != 0:
	print(f'9 {t - 9}')
else:
	print(f'10 {t - 10}')


def isSynthetic(num):
	for i in range(2, num):
		if num % i == 0 and int(num / i) > 1:
			return True
	return False
a = int(input())
for i in range(4, a - 4 + 1):
	if isSynthetic(i) and isSynthetic(a - i):
		print(i, a - i)
		break


def isprime(num):
	for i in range(2, num // 2 + 1):
		if num % i == 0:
			return False
	return True

def compo(num):
	for i in range(2, num // 2 + 1):
		a = num - i
		if isprime(a) == False and isprime(i) == False:
			return (i, a)
number = int(input())
(x, y) = compo(number)
print(x, y)


def func1(x):
	for i in range(x // 2):
		a = 4 + i
		b = x - a
		if a % 2 == 0:
			for j in range(b - 3):
				if b % (j + 2) == 0:
					return (a, b)
n = int(input())
(a, b) = func1(n)
print(a, b)


def main():
	x = int(input())
	if x % 2 == 0:
		print(8)
		print(x - 8)
	else:
		print(9)
		print(x - 9)
main()


import math
n = int(input())
val = (6, 4, 8)[n % 3]
print(val, n - val)


def isprime(n):
	if n == 2:
		return True
	if n == 3:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True
n = int(input())
i = 4
while True:
	x = n - i
	if isprime(x) == False and isprime(i) == False:
		print(x, i)
		break
	i += 1


x = int(input())
for i in range(4, x):
	if (i % 2 == 0 or i % 3 == 0) and ((x - i) % 2 == 0 or (x - i) % 3 == 0):
		print(i, x - i)
		break


n = int(input())

def funkcia(n):
	if n % 2 == 0:
		return (4, n - 4)
	return (9, n - 9)
(a, b) = funkcia(n)
print(a, b)


w = int(input())
f = 0
if w % 2 == 0:
	print(4, w - 4)
else:
	print(9, w - 9)


import math
n = int(input())
i = 4

def ifcompo(num):
	j = 2
	while j <= math.ceil(math.sqrt(num)):
		if num % j == 0:
			j += num
			return num
		else:
			j += 1
	return 0
while i <= n // 2:
	if ifcompo(i) != 0 and ifcompo(n - i) != 0:
		answer = str(i) + ' ' + str(n - i)
		print(answer)
		i += n
	else:
		i += 1


n = int(input())
if n % 2 == 0:
	print('8 ' + str(n - 8))
else:
	print('9 ' + str(n - 9))


n = int(input())

def composite(n):
	i = 2
	while i <= n / i:
		if n % i == 0:
			return True
		i += 1
	return False
i = 4
while i <= n - i:
	if composite(i) and composite(n - i):
		break
	i += 1
print(i, n - i)


def prime(x):
	cnt = 0
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			cnt += 1
			break
	if cnt == 1:
		return 1
	else:
		return 0
n = int(input())
for i in range(4, n):
	if prime(i) == 1 and prime(n - i) == 1:
		print(str(i) + ' ' + str(n - i))
		break


def prime(x):
	for i in range(2, x):
		if x % i == 0:
			return 1
	else:
		return 0
a = 0
b = 0
n = int(input())
for i in range(4, n):
	if prime(i):
		if prime(n - i):
			a = str(i)
			b = str(n - i)
			break
print(a + ' ' + b)


def isComp(num):
	for i in range(2, num):
		if num % i == 0:
			return True
	return False
n = int(input())
a = n - 4
b = 4
while isComp(a) == False or isComp(b) == False:
	a -= 1
	b += 1
print(a, b)


n = int(input())
N = [True] * (n + 1)
N[0] = False
N[1] = False
for i in range(2, n + 1):
	if N[i]:
		for k in range(i * i, n + 1, i):
			N[k] = False
for i in range(4, n + 1):
	if not N[n - i] and (not N[i]):
		print(n - i, i)
		break


def comp(n):
	return 1 if pow(2, n) % n != 2 % n else 0
n = int(input())
a = 4
while 1:
	if comp(n - a) == 1 and comp(a) == 1:
		print(a, n - a)
		break
	a += 1


n = int(input())

def p(m):
	bi = 0
	for i in range(2, m):
		if m % i == 0:
			bi = 1
			return 1
			break
	if bi == 0:
		return 0
for i in range(2, n):
	if p(i) == 1:
		if p(n - i) == 1:
			print(i, n - i)
			break


def is_prime(n):
	flag = 1
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			flag = 0
			break
	return flag
n = int(input())
for i in range(4, n // 2 + 1):
	if not is_prime(i) and (not is_prime(n - i)):
		print(i, n - i)
		exit(0)


def main():

	def is_notprime(n):
		return any((n % i == 0 and n != i for i in range(2, round(n ** 0.5) + 3)))

	def delitel(n):
		return [i for i in range(1, n // 2 + 2)]
	n = int(input())
	for i in delitel(n):
		if is_notprime(i) and is_notprime(n - i):
			print(i, n - i)
			exit()
main()


import math

def isprime(n):
	if n == 2:
		return True
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n):
	if not isprime(i) and (not isprime(n - i)):
		print(i, n - i)
		break


n = int(input())
for i in range(4, n):
	t = n - i
	c1 = 0
	c2 = 0
	for j in range(1, i + 1):
		if i % j == 0:
			c1 += 1
	if c1 == 2:
		continue
	for j in range(1, t + 1):
		if t % j == 0:
			c2 += 1
	if c2 == 2:
		continue
	print(i, t)
	break


def is_prime(n):
	return all([n % j for j in range(2, int(n ** 0.5) + 1)]) and n > 1
n = int(input())
(x, y) = (4, n - 4)
while x <= y:
	if not is_prime(x) and (not is_prime(y)):
		break
	else:
		x += 1
		y -= 1
print(str(x) + ' ' + str(y))


n = int(input())
if n % 2 == 0:
	x = 4
	y = n - 4
else:
	x = 9
	y = n - 9
seq = (str(x), str(y))
print(' '.join(seq))


def prime(n):
	return all([n % j for j in range(2, int(n ** 0.5) + 1)]) and n > 1
n = int(input())
first = 0
second = 0
for i in range(2, n - 1):
	first = i
	second = n - i
	if first + second == n and (not prime(first)) and (not prime(second)):
		break
print(first, second)


n = int(input())
table = [x for x in range(4, n, 2)]
count = 0
while count <= len(table):
	f_num = table[count]
	s_num = n - f_num
	if s_num % 2 == 0 or s_num % 3 == 0 or s_num % 5 == 0 or (s_num % 7 == 0):
		break
	else:
		count += 1
print(f_num, s_num)


def isPrime(n):
	if n == 1 or n == 2:
		return True
	if n % 2 == 0:
		return False
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
N = int(input())
a = N // 2
b = N - a
while isPrime(a) or isPrime(b):
	a -= 1
	b += 1
print(a, b)


def isprime(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	else:
		return True
n = int(input())
f = n - int(n / 2)
l = n - f
while isprime(f) or isprime(l):
	f -= 1
	l += 1
print(f, l)


t = int(input())
if t % 2 == 0:
	print(t - 4, 4)
else:
	print(t - 9, 9)


def isprime(n):
	d = 2
	while d * d <= n:
		if n % d == 0:
			return False
		d += 1
	return True
n = int(input())
x = n // 2
y = 0
if n % 2 == 0:
	y = n // 2
else:
	y = n // 2 + 1
while isprime(x) or isprime(y):
	x -= 1
	y += 1
print(x, y)


n = int(input())
if n % 2 == 0:
	print('4', int(n - 4))
elif n % 3 == 0:
	print('6', int(n - 6))
else:
	print('9', int(n - 9))


num = int(input())
if num % 2 == 0:
	print(num - 8, 8)
else:
	print(num - 9, 9)


def isprime(p):
	if p < 2:
		return False
	else:
		for scan in range(2, p):
			if p % scan == 0:
				return False
	return True
n = int(input())
found = False
if n < 12:
	print(-1)
else:
	for i in range(2, n - 3):
		if not found:
			if not isprime(n - i):
				if not isprime(i):
					print(n - i, i)
					found = True


import sys
n = int(input())
if n % 2 == 0:
	print(f'{4} {n - 4}')
else:
	print(f'{9} {n - 9}')


import math
global d

def is_prime(a):
	if a == 1:
		return False
	if a == 2:
		return True
	if a % 2 == 0:
		return False
	y = int(math.sqrt(a))
	for x in range(3, y + 1, 2):
		if a % x == 0:
			return False
	return True

def main():
	d = {}
	a = int(input())
	for z in range(3, a):
		if z not in d:
			b = not is_prime(z)
		if b:
			d[z] = z
		if a - z not in d:
			c = not is_prime(a - z)
		if c:
			d[a - z] = a - z
		if (c or a - z in d) and (b or z in d):
			print(str(z) + ' ' + str(a - z))
			return True
	return False
main()


n = int(input())
first = 4
second = n - first
while second % 2 != 0 and second % 3 != 0 and (second % 5 != 0) and (second % 7 != 0):
	first += 2
	second = n - first
print(first, second)


import math
primes = []

def isPrime(n):
	if n in primes:
		return True
	if n == 2 or n == 3 or n == 5:
		return True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	primes.append(n)
	return True
n = int(input().strip())
if n % 2 == 0:
	print(str(4) + ' ' + str(n - 4))
else:
	start = 4
	while True:
		if not isPrime(start) and (not isPrime(n - start)):
			print(str(start) + ' ' + str(n - start))
			break
		start += 1


import math

def is_prime(number):
	if number > 1:
		if number == 2:
			return True
		if number % 2 == 0:
			return False
		for current in range(3, int(math.sqrt(number) + 1), 2):
			if number % current == 0:
				return False
		return True
	return False
n = int(input())
for i in range(4, n // 2 + 1):
	if bool(is_prime(i)) is False and bool(is_prime(n - i)) is False:
		print(i, n - i)
		break


a = int(input())

def prime(number):
	n = number
	counter = 0
	for i in range(1, n + 1):
		if n % i == 0:
			counter += 1
	return 1 if counter == 2 else 0
b = a - 4
c = 4
while b > 4:
	if prime(c) == 0 and prime(b) == 0:
		break
	else:
		c += 1
		b -= 1
print(b, c)


a = int(input())
x = 4
y = a - 4
while True:
	if (x % 2 == 0 or x % 3 == 0) and (y % 2 == 0 or y % 3 == 0):
		print(x, y)
		break
	else:
		x += 1
		y -= 1


n = int(input())
(a, b) = (4, n - 4)

def isComposite(k):
	for i in range(2, k):
		if k % i == 0:
			return 1
	return 0
for i in range(1, n):
	if isComposite(a) and isComposite(b):
		print(a, b)
		exit()
	a += 1
	b -= 1


def composite(n):
	r = 1
	t = 0
	while r <= n:
		if n % r == 0:
			t = t + 1
			if t > 2:
				break
		r = r + 1
	if t > 2:
		return True
	else:
		return False
a = int(input())
r = 4
while r <= a:
	if composite(r) == True:
		r1 = a - r
		if composite(r1) == True:
			print(r, '', r1)
			break
	r = r + 1


n = int(input())
if n & 1:
	print('%d %d' % (9, n - 9))
else:
	print('%d %d' % (4, n - 4))


def op(x):
	z = False
	for y in range(2, int(x ** 0.5) + 1):
		if x % y == 0:
			z = True
			break
	return z
n = int(input())
k = (n - 1) // 2 + 1
x = n % 2 + n // 2
y = n // 2
for i in range(k + 1):
	if op(x + i) and op(y - i):
		print(y - i, x + i)
		break


from math import sqrt

def prost(t):
	if t == 0 or t == 1 or t == 2 or (t == 3):
		return False
	q = int(sqrt(t) + 1)
	for w in range(2, q):
		if t % w == 0:
			return True
	return False
n = int(input())
for x in range(n // 2 + 1):
	if prost(x) and prost(n - x):
		print(x, n - x)
		exit(0)


n = int(input())

def f(n):
	t = 0
	for i in range(1, n + 1):
		if n % i == 0:
			t += 1
	if t > 2:
		return 1
if n == 15:
	print(6, 9)
elif n == 13:
	print(4, 9)
elif n % 2 == 0:
	if n // 2 % 2 == 0:
		print(n // 2, n // 2)
	else:
		print(12, n - 12)
elif n == 17:
	print(8, 9)
else:
	print(15, n - 15)


x = int(input())
y = x % 2
if y == 0:
	print('8  ', x - 8)
elif y == 1:
	print('9 ', x - 9)


n = int(input())
if n & 1 == 0:
	print(4, n - 4)
else:
	print(9, n - 9)


def SieveOfEratosthenes(k):
	prime = [True for i in range(k + 1)]
	p = 2
	while p * p <= k:
		if prime[p] == True:
			for i in range(p * 2, k + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, k):
		if prime[p]:
			prima.append(p)
prima = []
n = int(input())
status1 = 1
status2 = 1
status3 = 1
if n % 2 == 0:
	a = n // 2
	b = n // 2
	SieveOfEratosthenes(n)
	while status3 == 1:
		if a % 2 != 0:
			for i in range(len(prima)):
				if prima[i] == a:
					status1 = 0
					break
			if status1 == -1:
				status1 = 1
			if status1 == 0:
				a += 1
				b -= 1
				status2 = -1
				status1 = 1
		else:
			status1 = 1
		if b % 2 != 0:
			for i in range(len(prima)):
				if prima[i] == b:
					status2 = 0
					break
			if status2 == -1:
				status2 = 1
			if status2 == 0:
				a += 1
				b -= 1
				status1 = -1
				status2 = 1
		else:
			status2 = 1
		if status2 == 1 and status1 == 1:
			status3 = 0
	print(a, b)
else:
	a = n // 2
	b = n // 2 + 1
	SieveOfEratosthenes(n)
	while status3 == 1:
		if a % 2 != 0:
			for i in range(len(prima)):
				if prima[i] == a:
					status1 = 0
					break
			if status1 == -1:
				status1 = 1
			if status1 == 0:
				a += 1
				b -= 1
				status2 = -1
				status1 = 1
		else:
			status1 = 1
		if b % 2 != 0:
			for i in range(len(prima)):
				if prima[i] == b:
					status2 = 0
					break
			if status2 == -1:
				status2 = 1
			if status2 == 0:
				a += 1
				b -= 1
				status1 = -1
				status2 = 1
		else:
			status2 = 1
		if status2 == 1 and status1 == 1:
			status3 = 0
	print(a, b)


x = int(input())
i = x % 2
if i == 0:
	print(6, x - 6)
else:
	print(9, x - 9)


n = int(input())
if n % 2 == 0:
	a = 4
	b = n - 4
else:
	num = [0] * (n + 1)
	for i in range(2, int(n ** 0.5) + 1):
		if num[i] == 0:
			j = 2
			while j * i <= n:
				num[j * i] = 1
				j += 1
	for i in range(4, n):
		if num[i] == 0:
			continue
		if num[n - i] == 0:
			continue
		a = i
		b = n - i
		break
print(a, end=' ')
print(b)


n = int(input())
check = 0
check = n % 2 + 8
print(check, n - check)


def isPrime(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(2, n):
	if isPrime(i) == False and isPrime(n - i) == False:
		print(i, n - i)
		break


def kilkdil(a):
	k = 0
	for i in range(1, a + 1):
		if a % i == 0:
			k += 1
	return k
n = int(input())
for i in range(4, n):
	if kilkdil(n - i) > 2 and kilkdil(i) > 2:
		print(n - i, i)
		break


import math
n = int(input())

def check_prime(k):
	for i in range(2, int(math.sqrt(k)) + 1):
		if k % i == 0:
			return True
	return False
for i in range(4, n, 2):
	if check_prime(n - i):
		print(i, n - i)
		break


n = int(input())
a = [4, 6, 8, 9, 10]
if n / 2 % 2 == 0:
	print(int(n / 2), int(n / 2))
else:
	for i in a:
		x = n - i
		if x % 2 == 0:
			print(i, x)
			break


n = int(input())
for i in range(2, n // 2):
	chk = True
	for j in range(2, n // 2):
		if (n - 2 * i) % j == 0:
			chk = False
			print('{} {}'.format(2 * i, n - 2 * i))
			break
		else:
			pass
	if chk == False:
		break


list_in = [0] * 1000000
for x in range(1, 1000000):
	if list_in[x] == 0:
		for y in range(2 * x + 1, 1000000, x + 1):
			list_in[y] = 1
target = int(input().strip())
for x in range(int(target / 2)):
	if list_in[x] and list_in[target - x - 2]:
		print(x + 1, target - x - 1)
		break


def IsPrime(n):
	c = 0
	for i in range(2, n):
		if n % i == 0:
			c = c + 1
	if c > 0:
		return 0
	else:
		return 1

def DesignTutorial(s):
	str1 = []
	for i in range(2, s // 2 + 1):
		for j in range(s // 2, s):
			if i + j == s and IsPrime(i) == 0 and (IsPrime(j) == 0):
				str1.append(i)
				str1.append(j)
				return str1
x = int(input())
l = DesignTutorial(x)
print(str(l[0]) + ' ' + str(l[1]))


def is_prime(n):
	if n % 2 == 0:
		return False
	for i in range(3, n // 2 + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
if n % 2 == 0:
	(x1, x2) = (n // 2 - 1, n // 2 + 1)
else:
	(x1, x2) = (n // 2, n // 2 + 1)
while is_prime(x1) or is_prime(x2):
	x1 -= 1
	x2 += 1
print(f'{x1} {x2}')


def check(a):
	for i in range(2, a):
		if a % i == 0:
			return 1
	return 0
n = int(input())
for i in range(4, n + 1):
	k = check(i)
	if k:
		h = check(n - i)
		if h:
			print(i, n - i)
			break


def prime(n):
	rootn = int(n ** 0.5)
	for i in range(rootn - 1):
		if n % (i + 2) != 0 and i < rootn - 2:
			continue
		elif n % (i + 2) != 0 and i == rootn - 2:
			return True
		else:
			return False
a = int(input())
for i in range(0, a // 2):
	if prime(a // 2 - i) == False and prime(a - (a // 2 - i)) == False:
		print(a // 2 - i, a - (a // 2 - i))
		break
	else:
		continue


n = int(input())
for a in range(n // 2, n):
	b = n - a
	if (a % 2 == 0 or a % 3 == 0) and (b % 2 == 0 or b % 3 == 0):
		print(a, b)
		exit()


from sys import stdin

def main():
	n = n0 = int(stdin.readline())
	scale = 1
	while not n & 1:
		scale *= 2
		n //= 2
	if n < 13:
		if n > 1:
			scale *= 2
		return (scale, n0 - scale)
	lim2 = n // 2 - 1
	sieve = [True] * lim2
	for i in range(lim2 // 3 + 1):
		if sieve[i]:
			(p, pp) = (2 * i + 3, (i + 3) * i * 2 + 3)
			sieve[pp::p] = [False for j in range(pp, lim2, p)]
	for (i, f) in enumerate(sieve):
		if not f:
			x = (i * 2 + 3) * scale
			return (x, n0 - x)
print(*main())


def split(n):
	if n % 2:
		return (9, n - 9)
	if n // 2 % 2:
		return (n // 2 - 1, n // 2 + 1)
	return (n // 2, n // 2)
n = int(input())
(a, b) = split(n)
print(a, ' ', b)


def judge(num):
	for i in range(2, num):
		if num % i == 0:
			return True
n = int(input())
for n1 in range(4, n - 3):
	n2 = n - n1
	if judge(n1) and judge(n2):
		break
print(str(n1) + ' ' + str(n2))


till = 1000000 + 1
prime = [True for i in range(till)]
root = 1000
for i in range(2, root + 1):
	if prime[i] == True:
		for i in range(i + i, till, i):
			prime[i] = False
n = int(input())
for i in range(4, n):
	if prime[i] == False and prime[n - i] == False:
		print(min(i, n - i), max(i, n - i))
		break


def prime(a, b):
	c = 0
	for j in range(2, b - 1):
		if b % j == 0:
			for k in range(2, a - 1):
				if a % k == 0:
					c = 1
					break
	if c == 1:
		return 1
	else:
		return 0
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	print(9, n - 9)


def not_simple(x):
	for i in range(2, min(x - 1, int(x ** 0.5 + 2))):
		if x % i == 0:
			return True
	return False
n = int(input())
for x in range(2, n + 1):
	if not_simple(x) and not_simple(n - x):
		print(str(x) + ' ' + str(n - x))
		break


n = int(input())

def divider(n):
	i = 2
	j = 0
	while i ** 2 <= n and j != 1:
		if n % i == 0:
			j = 1
		i += 1
	if j == 1:
		return True
	else:
		return False
a = 4
while True:
	if divider(n - a) and divider(a):
		print(a, n - a)
		break
	else:
		a += 1


number = input()
number = int(number)
if number % 2 == 0:
	ans = [4, number - 4]
else:
	ans = [number - 9, 9]
print(str(ans[0]) + ' ' + str(ans[1]))


def n_prime(ed):
	for i in range(2, ed):
		if ed % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n):
	if n_prime(i):
		if n_prime(n - i):
			print(i, n - i)
			break


def cekprima(x):
	z = x // 2
	prima = True
	if x == 1 or x == 0:
		prima = False
	while z >= 2 and prima == True:
		if x % z == 0:
			prima = False
		else:
			z -= 1
	return prima
n = int(input())
if n % 2 == 1:
	a = n // 2
	b = n // 2 + 1
else:
	a = n // 2
	b = n // 2
cek1 = cekprima(a)
cek2 = cekprima(b)
while cek1 == True or cek2 == True:
	a += 1
	b -= 1
	cek1 = cekprima(a)
	cek2 = cekprima(b)
print(a, b)


n = int(input())
composites = [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28]
finished = False
for i in range(28, int(n / 2) + 1):
	if i % 2 == 0:
		composites.append(i)
		continue
	for j in range(2, int(i ** 0.5) + 1):
		if i % j == 0:
			composites.append(i)
			break
for i in composites:
	for j in range(2, int((n - i) ** 0.5) + 1):
		if (n - i) % j == 0:
			print(str(i) + ' ' + str(n - i))
			finished = True
			break
	if finished:
		break


def main():
	N = int(input())
	primes = [True] * (10 ** 6 + 1)
	i = 2
	primes[0] = primes[1] = False
	while i * i <= 10 ** 6:
		for j in range(i * i, 10 ** 6 + 1, i):
			primes[j] = False
		i += 1
	for i in range(2, N + 1):
		if primes[i] == False and primes[N - i] == False:
			print(i, N - i)
			break
main()


x = int(input())
print(x % 2 + 8, x - (x % 2 + 8))


n = int(input())
if n % 2 == 0:
	print(4, n - 4)
elif n % 3 == 0:
	print(6, n - 6)
elif n % 12 == 1:
	print(4, n - 4)
elif n % 12 == 5:
	print(8, n - 8)
elif n % 12 == 7:
	print(10, n - 10)
else:
	print(14, n - 14)


n = int(input())
ch = True
i = 2
j = 2
while ch:
	while ch:
		a = i * j
		b = n - a
		for k in range(2, b // 2 + 1):
			if b % k == 0:
				ch = False
		j += 1
	i += 1
print(a, b)


n = int(input().strip())
if n % 2 == 0:
	print('4 ' + str(n - 4))
elif n % 3 == 0:
	print('6 ' + str(n - 6))
elif n % 3 == 1:
	print('4 ' + str(n - 4))
else:
	print('8 ' + str(n - 8))


def is_prime(n):
	if n == 1:
		return False
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
half = int(n / 2)
i = 4
while i <= half:
	if not is_prime(i) and (not is_prime(n - i)):
		print(i, n - i)
		break
	else:
		i += 1


import math

def is_composite(num):
	if num <= 2:
		return False
	if num % 2 == 0:
		return True
	max = math.ceil(math.sqrt(num))
	for n in range(3, max + 1, 2):
		if num % n == 0:
			return True
	return False

def main():
	n = int(input())
	a = n // 2
	b = math.ceil(n / 2)
	while True:
		if is_composite(a) and is_composite(b):
			print(str(a) + ' ' + str(b))
			break
		else:
			a -= 1
			b += 1
main()


n = int(input())
a = []

def p(i):
	for j in range(2, i):
		if i % j == 0:
			return True
	return False
for i in range(4, n):
	if p(i) and p(n - i):
		print(i, n - i)
		break


from math import sqrt

def composite(x):
	for _ in range(2, x):
		if x % _ == 0:
			return True
		elif _ == x - 1:
			return False
		else:
			continue
inp = int(input())
i = 2
(j, k) = (2, inp - 2)
while 1:
	if composite(j) and composite(k):
		print(j, k)
		break
	elif j == inp // 2:
		break
	else:
		j += 1
		k = inp - j


def p(n):
	i = 2
	while i <= n / 2:
		if n % i == 0:
			return True
		i += 1
	return False
n = int(input())
for x in range(4, n):
	if p(x) & p(n - x):
		print(x, n - x)
		break


def isPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
a = n // 2
b = n - a
if not isPrime(a) and (not isPrime(b)):
	print(a, b)
elif not isPrime(a - 1) and (not isPrime(b + 1)):
	print(a - 1, b + 1)
elif not isPrime(a - 2) and (not isPrime(b + 2)):
	print(a - 2, b + 2)
elif not isPrime(a - 3) and (not isPrime(b + 3)):
	print(a - 3, b + 3)
elif not isPrime(a - 5) and (not isPrime(b + 5)):
	print(a - 5, b + 5)
elif not isPrime(a - 7) and (not isPrime(b + 7)):
	print(a - 7, b + 7)


__author__ = 'Utena'

def com(a):
	j = 0
	for i in range(2, a - 1):
		if a % i == 0:
			j = 1
			break
	return j
n = int(input())
for i in range(4, n - 4):
	if com(i) == 1 and com(n - i) == 1:
		print('%d %d' % (i, n - i))
		break


num = int(input())

def isComposite(num):
	c = 0
	for i in range(1, num + 1):
		if num % i == 0:
			c += 1
	if c == 2:
		return False
	else:
		return True
for i in range(4, num):
	j = num - i
	if isComposite(i) and isComposite(j):
		break
print(i, j)


n = int(input())

def prost(a):
	t = 2
	while a % t != 0:
		t += 1
	return t == a
for i in range(4, n - 4, 1):
	if prost(n - i) == False and prost(i) == False:
		print(i, n - i)
		break


a = int(input())
bool = False
bool1 = False
bool2 = True
cnt = 0
cnt1 = 0
for i in range(1, a):
	cnt = 0
	cnt1 = 0
	for j in range(1, i + 1):
		if i % j == 0:
			cnt += 1
	for k in range(1, int((a - i) / 2 + 1)):
		if (a - i) % k == 0:
			cnt1 += 1
	if cnt > 2 and cnt1 >= 2:
		print(i, a - i)
		break


n = int(input())
x = 1
y = n - 1

def is_prime(a):
	x = True
	for i in range(2, a):
		if a % i == 0:
			x = False
			break
	return x
while x < n:
	if x + y == n and (not is_prime(x)) and (not is_prime(y)):
		print('{} {}'.format(x, y))
		break
	x += 1
	y -= 1


import random
a = int(input())

def chislo(a):
	b = 1
	c = random.randrange(b, a)
	return c
s = chislo(a)
x = a - s

def IsPrime(s):
	d = 2
	while s % d != 0:
		d += 1
	if d != s:
		return True
	else:
		return False
while IsPrime(s) != True or IsPrime(x) != True:
	s = chislo(a)
	x = a - s
print(x, s)


a = int(input())
if a & 1:
	print(9, a - 9)
else:
	print(4, a - 4)


t = int(input())
if t % 2 == 0:
	print(f'8 {t - 8}')
else:
	print(f'9 {t - 9}')


n = int(input())
if not n % 2:
	a = 4
	b = n - 4
elif n % 2:
	a = 9
	b = n - 9
print(a, b)


n = int(input())
import math
prime = []
for i in range(2, 100):
	for j in range(2, math.floor(math.sqrt(i)) + 1):
		if i % j == 0:
			break
	else:
		prime.append(i)
if not n & 1:
	print(4, n - 4)
else:
	odd = 3
	while odd in prime:
		odd += 2
	print(odd, n - odd)


cislo = int(input())
if cislo % 2 == 0:
	print(4, cislo - 4)
else:
	print(9, cislo - 9)


R = lambda : map(int, input().split())
n = int(input())
print(*((9, n - 9) if n % 2 else (8, n - 8)))


from math import sqrt, ceil
n = int(input())

def is_composite(n: int):
	if n == 1 or n == 2:
		return False
	for i in range(2, int(ceil(sqrt(n))) + 1):
		if n % i == 0:
			return True
	return False
for i in range(3, int(ceil(n / 2))):
	if is_composite(i) and is_composite(n - i):
		print(str(i) + ' ' + str(n - i))
		quit()


def isPrime(a):
	if a == 1 or a == 2:
		return True
	for i in range(2, a):
		if a % i == 0:
			return False
		if i * i > a:
			return True
n = int(input())
if n % 2 == 0:
	print('4 ' + str(n - 4))
else:
	for k in range(4, n // 2 + 2):
		if not isPrime(k) and (not isPrime(n - k)):
			print(str(k) + ' ' + str(n - k))
			break


def notprime(a):
	for i in range(2, a):
		if a % i == 0:
			return 1
	return 0
n = int(input())
for i in range(2, n):
	if notprime(i) and notprime(n - i):
		print(i, end=' ')
		print(n - i)
		break


from math import sqrt
n = int(input())

def primeList(N):
	a = list(range(N + 1))
	a[1] = 0
	res = []
	i = 2
	while i <= N:
		if a[i] != 0:
			res.append(a[i])
			for j in range(i, N + 1, i):
				a[j] = 0
		i += 1
	res.extend([x for x in a if x != 0])
	return res
res = []
primes = primeList(n)
for i in range(4, n):
	if n - i not in primes and i not in primes:
		res.append(i)
		res.append(n - i)
		break
print(*res)


def is_Prime(n):
	if n % 2 == 0 and n != 2:
		return False
	d = 3
	while d * d <= n and n % d != 0:
		d += 2
	return d * d > n
n = int(input())
if n % 2 == 0 and (not is_Prime(n // 2)):
	print(n // 2, n // 2)
	exit()
if n % 2 == 0:
	(num1, num2) = (n // 2, n // 2)
else:
	(num1, num2) = (n // 2, n // 2 + 1)
while is_Prime(num1) or is_Prime(num2):
	num1 -= 1
	num2 += 1
print(num1, num2)


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def no():
	print('NO')
	return

def yes():
	print('YES')
	return

def solve(case_no):
	n = int(input())
	if n % 2 == 0:
		print(4, n - 4)
	else:
		print(9, n - 9)
t = 1
for i in range(1, t + 1):
	solve(i)


n = int(input())

def prime(a):
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return 0
			break
	else:
		return 1
for i in range(2, int(n * 0.5) + 1):
	if prime(i) == 0 and prime(n - i) == 0:
		print(i, n - i)
		break


num = int(input())

def isfushu(n):
	for i in range(n - 2):
		if n % (i + 2) == 0:
			return True
	return False
for i in range(num):
	if isfushu(i + 1) is True and isfushu(num - i - 1) is True:
		print(i + 1, num - i - 1)
		break


n = int(input())
if n % 2 == 1:
	print(9, end=' ')
	print(n - 9)
else:
	print(8, end=' ')
	print(n - 8)


def sost(a):
	k = 0
	for i in range(1, a + 1):
		if a % i == 0:
			k += 1
			if k > 2:
				return True
	if k <= 2:
		return False
n = int(input())
for i in range(1, n):
	if sost(i) and sost(n - i):
		print(i, n - i)
		break


def compositeNumbers(x):
	for i in range(4, x + 1):
		if i % 2 == 0 or i % 3 == 0:
			if (x - i) % 2 == 0 or (x - i) % 3 == 0:
				return i
t = int(input())
if t % 2 == 0:
	composite = compositeNumbers(int(t / 2))
	print(int(composite), int(t - composite))
else:
	composite = compositeNumbers(t)
	print(composite, t - composite)


def compositeNums(n):
	if n % 2 == 0:
		return (4, n - 4)
	return (9, n - 9)
n = int(input())
print(*compositeNums(n))


import math

def isNotPrime(num):
	if num % 2 == 0:
		return True
	else:
		for i in range(3, int(math.sqrt(num)) + 1, 2):
			if num % i == 0:
				return True
	return False
a = int(input())
if a % 2 == 0:
	b = a / 2
else:
	b = (a + 1) / 2
c = a - b
i = 0
while i < a / 2:
	if isNotPrime(b) and isNotPrime(c):
		break
	else:
		b -= 1
		c += 1
		i += 1
print(int(b), int(c))


n = int(input())
sieve = [True for i in range(n + 1)]
for i in range(2, int(n ** 0.5) + 1):
	if sieve[i]:
		for j in range(i, n // i + 1):
			sieve[i * j] = False
sieve = sieve[2:]
for i in range(n - 3):
	if not sieve[i] and (not sieve[n - 2 - (i + 2)]):
		print(i + 2, n - (i + 2))
		break


def fakeBach(n):
	primeDict = quickSieve(n)
	for num in range(2, n):
		if primeDict[num] == False:
			i = n - num
			if primeDict[i] == False:
				return [str(num), str(i)]

def quickSieve(n):
	numDict = {2: True}
	for i in range(3, n + 1):
		numDict[i] = True
	for num in numDict:
		if numDict[num]:
			i = num
			while num <= n - i:
				num += i
				numDict[num] = False
	return numDict
print(' '.join(fakeBach(int(input()))))


s = int(input())
print(*[[4, s - 4], sorted([9, s - 9])][s % 2])


n = int(input())
if n % 2 == 0:
	t = n - 8
else:
	t = n - 9
print(t)
print(n - t)


def divided(n):
	if (n - 4) % 3 == 0:
		return str(4) + ' ' + str(n - 4)
	elif (n - 6) % 3 == 0:
		return str(6) + ' ' + str(n - 6)
	elif (n - 8) % 3 == 0:
		return str(8) + ' ' + str(n - 8)
print(divided(int(input())))


n = int(input())
k = n // 3
if n % 3 == 0:
	print(6, 3 * (k - 2))
elif n % 3 == 1:
	print(4, 3 * (k - 1))
else:
	print(8, 3 * (k - 2))


from sys import stdin, stdout
from math import ceil, floor, sqrt
from collections import deque
inp = stdin.readline
out = stdout.write
n = int(inp().strip())
(x, y) = (8 + (n & 1), n - (8 + (n & 1)))
print(x, y)


x = int(input())
if x % 2 == 0:
	s1 = 4
	s2 = x - s1
	print(f'{s1} {s2}')
else:
	s1 = x // 2
	s1 += 3 - s1 % 3
	if s1 % 2 == 0:
		s1 -= 3
	s2 = x - s1
	print(f'{s1} {s2}')


from sys import stdin
n = int(stdin.readline())
composite_numbers = []
for x in range(4, 1000000):
	if x % 2 == 0 or x % 3 == 0:
		composite_numbers.append(x)
for x in composite_numbers:
	y = n - x
	if y in composite_numbers:
		print(x, y)
		exit()


n = int(input())
possible = [4, 6, 8]
for item in possible:
	a = n - item
	count = 0
	for i in range(2, a):
		if a % i == 0:
			count = 1
			break
	if count == 1:
		print(item, a)
		break


import math

def is_prime(x):
	if x == 2:
		return True
	if x < 2 or x % 2 == 0:
		return False
	i = 3
	while i <= math.sqrt(x):
		if x % i == 0:
			return False
		i = i + 2
	return True
n = int(input())
if n % 4 == 0:
	print(int(n / 2), int(n / 2))
elif n % 2 == 0:
	x = math.floor(int(n / 2) / 2) * 2
	print(x, n - x)
else:
	x = math.floor(int(n / 2) / 2) * 2
	judge = is_prime(n - x)
	while judge:
		x -= 2
		judge = is_prime(n - x)
	print(x, n - x)


N = int(input(''))

def Primo(N):
	Res = True
	K = 2
	while K < N:
		if N % K == 0:
			Res = False
			break
		K = K + 1
	return Res
X = 4
Y = N - X
Res = False
while Res == False:
	if Primo(X) == False and Primo(Y) == False:
		print(X, ' ', Y)
		break
	else:
		X = X + 1
		Y = N - X


def isprime(n):
	return all((n % i for i in range(2, n)))
n = int(input())
n = n - 4
c = 0
y = z = False
while True:
	if isprime(n - c):
		c = c + 1
	else:
		y = True
	if isprime(4 + c):
		c = c + 1
	else:
		z = True
	if y == True and z == True:
		break
print(n - c, 4 + c)


import math

def eh_primo(num):
	divs = 0
	raiz = int(math.ceil(math.sqrt(num)))
	for e in range(1, raiz + 1):
		if num % e == 0:
			if num // e == e:
				divs += 1
			else:
				divs += 2
		if divs >= 3:
			return False
	return True
n = int(input())
if n % 2 == 0:
	nums = [n // 2, n // 2]
	if eh_primo(n // 2):
		nums = [n // 2 + 1, n // 2 - 1]
else:
	nums = [n // 2, n // 2 + 1]
	while True:
		if eh_primo(nums[0]) or eh_primo(nums[1]):
			nums[0] += 1
			nums[1] -= 1
		else:
			break
print(nums[0], nums[1])


def ifprime(x):
	a = 1
	for i in range(1, x - 1):
		if x / (i + 1) == x // (i + 1):
			a = 0
			break
		else:
			pass
	return a
n = int(input())
for i in range(2, n // 2 + 1):
	if ifprime(i) == 0 and ifprime(n - i) == 0:
		print(i, n - i)
		break
	else:
		pass


def is_composite(n):
	for x in range(2, n // 2):
		if n % x == 0:
			return True
	else:
		return False
n = int(input())
if n % 2 == 0 and n - 10 > 2:
	print(n - 10, 10)
elif n % 10 == 0:
	print(n / 2, n / 2)
else:
	for x in range(3, n):
		if (n - x) % 2 == 0 and n - x > 2 and is_composite(x):
			print(n - x, x)
			break


n = int(input())
p = t = 0
found = 0
for i in range(4, n):
	valid = 0
	for j in range(2, i):
		if i % j == 0:
			valid = 1
			p = i
			break
	if valid == 1:
		t = n - p
		for j in range(2, t):
			if t % j == 0:
				found = 1
				break
	if found == 1:
		print(p, t)
		break


def isprime(n):
	if n <= 1:
		return False
	if n == 2 or n == 3:
		return True
	if n == 5:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
i = 4
while True:
	if isprime(n - i) or isprime(i):
		pass
	else:
		print(i, n - i)
		break
	i += 1


n = int(input())

def prime(a):
	if a < 2:
		return False
	else:
		for i in range(2, a):
			if a % i == 0:
				return False
		return True

def composite(a):
	if a < 2:
		return False
	else:
		return not prime(a)
for i in range(n + 1):
	if composite(i) and composite(n - i):
		print(i, n - i)
		break


n = int(input())
m = [True for i in range(n + 1)]
for i in range(2, int(n ** (1 / 2)) + 1):
	if m[i]:
		for j in range(2 * i, n + 1, i):
			m[j] = False
ccc = [i for i in range(n + 1) if m[i]]
for i in range(n + 1):
	if not i in ccc and (not n - i in ccc):
		print('{} {}'.format(i, n - i))
		exit()


from math import sqrt, ceil, floor

def isPrime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
a = ceil(n / 2)
b = floor(n / 2)
while isPrime(a) or isPrime(b):
	a += 1
	b -= 1
print(a, b)


def is_prime(m):
	prime = True
	for a in range(2, int(m ** 0.5) + 1):
		if m % a == 0:
			prime = False
	return prime
a = int(input())
i = 2
while True:
	k = a - i * 2
	if is_prime(k) == True:
		i += 1
	else:
		break
print(i * 2, k)


def primo(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	return True
n = int(input())
if n % 2 != 0:
	aux = n - 4
	while primo(aux) != False or aux % 2 == 0:
		aux -= 1
	print(aux, n - aux)
else:
	aux = n // 2
	if aux % 2 == 0:
		print(aux, aux)
	else:
		print(aux - 1, aux + 1)


k = int(input())

def composite(j):
	for i in range(2, j):
		if j % i == 0:
			return j
		else:
			return 0
m = 0
for i in range(4, k):
	for j in range(2, i):
		if i % j == 0:
			t = composite(k - i)
			if t == k - i:
				print(i, t)
				m = 1
				break
			else:
				continue
	if m == 1:
		break


import math
import sys
import os
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	print(9, n - 9)


n = int(input())
import math
ans = 0
if n % 2 == 0:
	ans = 4
if ans == 0:
	ans = 9
print(ans, end='')
print(' ', end='')
print(n - ans)


import sys
n = int(sys.stdin.readline())
if n % 2:
	print('%d %d' % (9, n - 9))
else:
	print('%d %d' % (4, n - 4))


n = int(input())
if not n & 1:
	print(n - 4, 4)
else:
	print(n - 9, 9)


__author__ = 'Devesh Bajpai'

def solve(n):
	if n % 2 == 0:
		result = [4, n - 4]
	else:
		result = [9, n - 9]
	return str(result[0]) + ' ' + str(result[1])
n = int(input())
print(solve(n))


from sys import stdin, exit
num = int(stdin.readline())
if num % 2 == 0:
	print(f'4 {num - 4}')
else:
	print(f'9 {num - 9}')


n = int(input())

def com(num):
	s = 0
	if num > 1:
		for i in range(2, num):
			if num % i == 0:
				s = 1
				break
	return s
for x in range(2, n - 1):
	y = n - x
	if com(y) == 1 and com(x) == 1:
		print(x, y)
		break
	else:
		continue


import math as m

def isComp(n):
	isComp = False
	for i in range(2, m.floor(m.sqrt(n)) + 1):
		if n % i == 0:
			isComp = True
			break
	return isComp
n = int(input())
for i in range(4, n - 3):
	if isComp(i) and isComp(n - i):
		print(i, n - i)
		break


inp = int(input())

def is_prime(x):
	prime = 5
	if x <= 1:
		prime = 0
		return prime
	elif x % 2 == 0:
		if x == 2:
			prime = 1
			return prime
		else:
			prime = 0
			return prime
	elif x == 3:
		prime = 1
		return prime
	else:
		i = 3
		while i < x:
			if i == x - 1:
				prime = 1
				return prime
				break
			if x % i == 0:
				prime = 0
				return prime
				break
			i += 1
a = 2
b = inp - a
while True:
	if is_prime(a) == 1 or is_prime(b) == 1:
		a = a + 1
		b = inp - a
	else:
		print(str(a) + ' ' + str(b))
		break


n = int(input())
a = [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50]
if n / 2 % 2 == 0:
	print(int(n / 2), int(n / 2))
else:
	for i in a:
		x = n - i
		if x % 2 == 0:
			print(i, x)
			break


n = int(input())
answer = []

def is_composite(num):
	no_factors = 2
	for i in range(2, num):
		if num % i == 0:
			no_factors += 1
			break
	if no_factors == 3:
		return True
	else:
		return False
for x in range(n):
	num1 = x
	num2 = n - x
	if is_composite(num1):
		if is_composite(num2):
			answer.append(str(num1))
			answer.append(str(num2))
			break
for number in answer:
	print(number)


n = int(input())
count1 = 0
count2 = 0
for x in range(2, n):
	for i in range(2, x):
		if x % i == 0:
			count1 = 1
			for j in range(2, n - x):
				if (n - x) % j == 0:
					count2 = 1
					break
	if count1 == 1 and count2 == 1:
		print(x, n - x)
		break


def isComposite(x):
	if x < 3:
		return False
	for a in range(2, int(x ** 0.5) + 1):
		if x % a == 0:
			return True
	return False
c = input()
case = int(c)

def compositeSum(c):
	for b in range(4, c):
		if isComposite(b) is True:
			if isComposite(c - b) is True:
				s = ''
				s = s + str(b) + ' '
				s = s + str(c - b)
				return s
	return ''
print(compositeSum(case))


n = int(input())
for i in range(4, n):
	x = i
	y = n - i
	if x == 5 or x == 7:
		continue
	if (x % 2 == 0 or x % 3 == 0 or x % 5 == 0 or (x % 7 == 0)) and (y % 2 == 0 or y % 3 == 0 or y % 5 == 0 or (y % 7 == 0)):
		print(x, y)
		break


from math import gcd

def solve():
	n = int(input())
	if n % 2 == 0:
		print(8)
		print(n - 8)
	else:
		print(9)
		print(n - 9)
solve()


n = int(input())
i = 2
j = k = 1
K = J = 0
while i < n:
	while j <= i:
		if i % j == 0:
			J += 1
		j += 1
		if J > 2:
			break
	while k <= n - i:
		if (n - i) % k == 0:
			K += 1
		k += 1
		if K > 2:
			break
	if J > 2 and K > 2:
		break
	i += 1
	j = k = 1
	J = K = 0
print(i, n - i)


a = int(input())
for i in range(2, a // 2):
	b = a - 2 * i
	if b % 2 == 0 or b % 3 == 0:
		print(2 * i, b)
		break


def check(t):
	for i in range(2, round(t ** 0.5) + 1):
		if t % i == 0:
			return t
			break
	else:
		return 0
a = int(input())
for x in range(4, a - 3):
	if check(x) == x and check(a - x) == a - x:
		break
print(x, a - x)


n = int(input())

def divisionNum(n):
	a = []
	i = 1
	while i ** 2 <= n:
		if n % i == 0:
			a.append(i)
			if i != n // i:
				a.append(n // i)
		elif len(a) > 2:
			break
		i += 1
	return a
i = 0
while True:
	if len(divisionNum(n // 2 + i)) > 2 and len(divisionNum(n - (n // 2 + i))) > 2:
		print(n // 2 + i, n - (n // 2 + i))
		break
	else:
		i += 1


import math

def is_prime(x):
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return False
	else:
		return True
n = int(input())
for i in range(2, n):
	if not is_prime(i) and (not is_prime(n - i)):
		print(i, n - i)
		break


n = 10 ** 6
prime = [1 for i in range(n + 1)]
p = 2
while p * p <= n:
	if prime[p] == 1:
		for i in range(p * p, n + 1, p):
			prime[i] = 0
	p += 1
n = int(input())
a = n // 2
while prime[a] == 1 or prime[n - a] == 1:
	a -= 1
print(a, end=' ')
print(n - a)


n = int(input())
q = int(n / 12)
d = n - 12 * q
if d == 0:
	print(str(6 * q) + ' ' + str(6 * q))
elif d == 1:
	print(str(9 * q) + ' ' + str(3 * q + 1))
elif d == 2:
	print(str(4 * q) + ' ' + str(8 * q + 2))
elif d == 3:
	print(str(6 * q) + ' ' + str(6 * q + 3))
elif d == 4:
	print(str(4 * q) + ' ' + str(8 * q + 4))
elif d == 5:
	print(str(6 * q + 2) + ' ' + str(6 * q + 3))
elif d == 6:
	print(str(6 * q + 3) + ' ' + str(6 * q + 3))
elif d == 7:
	print(str(6 * q + 4) + ' ' + str(6 * q + 3))
elif d == 8:
	print(str(4 * q) + ' ' + str(8 * q + 8))
elif d == 9:
	print(str(6 * q + 6) + ' ' + str(6 * q + 3))
elif d == 10:
	print(str(4 * q) + ' ' + str(8 * q + 10))
elif d == 11:
	print(str(6 * q + 8) + ' ' + str(6 * q + 3))


import sys
x = int(sys.stdin.readline().rstrip())
if x % 2 == 0:
	print(str(x - 4) + ' ' + '4')
else:
	print(str(x - 9) + ' ' + '9')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	n = int(input())
	x = n
	if n % 2 != 0:
		x -= 9
	elif n % 2 == 0:
		x -= 8
	print(x, n - x)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


a = int(input())
if a % 2 == 0 or a % 3 == 0:
	print(6, a - 6)
if a % 6 == 1:
	print(4, a - 4)
if a % 6 == 5:
	print(9, a - 9)


import sys

def solve():
	n = int(input())
	if n % 2 == 0:
		print(4, n - 4)
		return
	else:
		is_prime = eratos(10 ** 6 + 1)
		for x in range(4, n):
			if not is_prime[x] and (not is_prime[n - x]):
				print(x, n - x)
				return

def eratos(n):
	sieve = [True] * n
	sieve[0] = sieve[1] = False
	for p in range(2, n):
		if p * p > n:
			break
		if sieve[p]:
			for q in range(p * p, n, p):
				sieve[q] = False
	return sieve
solve()


def prime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(3, n // 2 + 1):
	if not prime(i):
		if not prime(n - i):
			print(i, n - i)
			exit(0)


from sys import stdin
n = stdin.readline().rstrip()
n = int(n)
already_checked = dict()

def check_composite(x):
	if x in already_checked:
		return already_checked[x]
	for i in range(2, int(x ** (1 / 2) + 1)):
		if x % i == 0:
			already_checked[x] = True
			return True
	already_checked[x] = False
	return False
(x, y) = (1, n - 1)
for i in range(n):
	if check_composite(x) and check_composite(y):
		break
	x += 1
	y -= 1
print(str(x) + ' ' + str(y))


from math import sqrt

def isNotPrime(n):
	if n == 1:
		return True
	if n == 2:
		return False
	for i in range(2, int(sqrt(n) + 2)):
		if n % i == 0:
			return True
			break
	else:
		return False
n = int(input())
for i in range(4, n - 4):
	if isNotPrime(i) and isNotPrime(n - i):
		print(' '.join(map(str, (i, n - i))))
		break


print(*(lambda x: str(8) + '+' + str(x - 8) if (x - 8) % 2 == 0 else str(9) + '+' + str(x - 9))(int(input())).split('+'))


number = int(input())
x = int(number / 2)
y = number - x
z = 0
for z in range(z, number):
	if (x % 2 == 0 or x % 3 == 0) and (y % 2 == 0 or y % 3 == 0):
		print(x, y)
		if (x == 2 or x == 3 or x < 5) or (y == 2 or y == 3 or y < 5):
			break
		break
	else:
		if (x == 2 or x == 3 or x < 5) or (y == 2 or y == 3 or y < 5):
			break
		y = y + 1
		x = x - 1


def pr(a):
	if a < 2:
		return 0
	if a == 2:
		return 1
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return 0
	return 1
a = int(input())
o = 0
for i in range(4, a - 1, 2):
	if pr(a - i) != 1:
		print(a - i, i)
		break


n = int(input())
print(*[[n - 8, 8], [n - 9, 9]][n % 2 == 1])


from math import sqrt, ceil

def is_prime(x):
	isPrime = True
	if x == 1:
		isPrime = False
	for i in range(2, ceil(sqrt(x)) + 1):
		if x % i == 0:
			isPrime = False
			break
	return isPrime
n = int(input())
if n % 2 == 0 and (not is_prime(n / 2)):
	print(str(int(n / 2)), str(int(n / 2)))
else:
	x = 4
	while is_prime(x) or is_prime(n - x) or n - x in [1, 2, 3]:
		x += 1
	print(x, str(n - x))


def solve(n):
	if n % 2 == 0:
		a = n - 4
	else:
		a = n - 9
	b = n - a
	return str(a) + ' ' + str(b)
n = int(input())
print(solve(n))


number = int(input())
if number == 12:
	print('4 8')
	exit(0)
list = [4, 6, 8]
for i in list:
	if (number - i) % 3 == 0:
		print(str(i) + ' ' + str(number - i))


def isPrime(a):
	for i in range(2, int(a ** (1 / 2)) + 1):
		if a % i == 0:
			return False
	return True
n = int(input())
t = n - 4
while t >= n // 2:
	if not isPrime(t) and (not isPrime(n - t)):
		print(t, n - t)
		break
	t -= 1


def prost(x):
	flag = True
	i = 2
	x1 = x
	while x > 1:
		while x % i == 0:
			x //= i
			flag = False
		if i == x1:
			flag = True
		i += 1
	return flag
a = int(input())
x = 4
y = a - 4
while prost(x) or prost(y):
	x += 1
	y -= 1
print(x, y)


def EstPrem(p):
	P = int(p ** 0.5 + 1)
	for i in range(2, P):
		if p % i == 0:
			return 0
	return 1

def Sol(n):
	(a, b) = (n // 2, n - n // 2)
	while EstPrem(a) or EstPrem(b):
		(a, b) = (a - 1, b + 1)
	print(a, b)
	return None
Sol(int(input()))


a = int(input())
(b, c) = (0, 0)
validb = False
validc = False
for i in range(4, a):
	(b, c) = (i, a - i)
	for j in range(2, b):
		if b % j == 0:
			validb = True
			break
	for k in range(2, c):
		if c % k == 0:
			validc = True
			break
	if validb and validc:
		print(b, c)
		break
	else:
		validb = False
		validc = False


number = int(input())
if number % 2 == 0:
	print(4, number - 4)
else:
	print(9, number - 9)


n = int(input())
ans = n % 2 + 8
print(ans, n - ans)


import math
n = int(input())
i = 4
j = 0
flag = 0
if n % 2 == 0:
	print(i, n - i)
else:
	while i < int(n / 2) + 1:
		for j in range(2, int(math.sqrt(n - i) + 1)):
			if (n - i) % j == 0:
				print(i, n - i)
				flag = 1
				break
		if flag == 1:
			break
		else:
			i += 2


import sys

def math():
	data = [line.rstrip().split() for line in sys.stdin.readlines()]
	data = [[int(x) for x in row] for row in data]
	n = data[0][0]
	i = 4
	while True:
		if helper(n - i) == 1:
			print(str(i) + ' ' + str(n - i))
			break
		i = i + 2

def helper(a):
	flag = 0
	t = 2
	while t * t <= a:
		if a % t == 0:
			flag = 1
			break
		t = t + 1
	return flag
math()


n = int(input())
from math import ceil
from math import sqrt

def composite(x):
	b = False
	for i in range(2, ceil(sqrt(x)) + 1):
		if x % i == 0 and x != i:
			b = True
			break
	return b
for i in range(1, ceil((n + 1) / 2)):
	a = n - i
	if composite(a) and composite(i):
		print(i, a)
		break


x = int(input())
if x % 2 == 0:
	for i in range(4, x + 1):
		if (x - i) % 2 == 0 and i % 2 == 0:
			print(i, x - i)
			break
else:
	print('9', x - 9)


def isPrime(n):
	if n == 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i += 6
	return True
s = int(input())
for i in range(4, s):
	j = s - i
	if isPrime(i) == False and isPrime(j) == False:
		print(i, j)
		break


def CheckPrime(n):
	(i, count) = (1, 0)
	while i <= n:
		count += 1 if n % i == 0 else 0
		i += 1
	return count < 3
n = int(input())
while True:
	temp = 4
	while temp < n:
		if not CheckPrime(temp) and (not CheckPrime(n - temp)):
			print(temp, n - temp)
			exit()
		temp += 1


def iscom(n):
	for i in range(2, n - 1):
		if n % i == 0:
			return 1
	return 0
count = 0
n = int(input())
if n % 2 == 0:
	print('4', str(n - 4))
else:
	i = 3
	j = n - 3
	while i < j:
		i += 1
		j -= 1
		if iscom(i) == 1 and iscom(j) == 1:
			print(i, j)
			break


n = int(input())
if n % 2 == 0:
	p = int(n / 2)
	if p % 6 != 5 and p % 6 != 1:
		print(str(p) + ' ' + str(p))
		exit()
for i in range(4, n):
	if i % 6 == 5 or i % 6 == 1:
		continue
	y = n - i
	if y % 6 == 5 or y % 6 == 1:
		continue
	print(str(i) + ' ' + str(y))
	break


def checkPrime(m):
	for i in range(2, m // 2 + 1):
		if m % i == 0:
			return True
	return False

def compositeNumber(n):
	j = 4
	while j < n:
		if checkPrime(j):
			if checkPrime(n - j):
				print(j, n - j)
				break
		j += 1
n = int(input())
compositeNumber(n)


s = int(input())
a1 = 9
if s % 2 == 0:
	a1 = 8
a2 = s - a1
print(a1, a2)


def prime(n):
	d = 2
	while d < n:
		if n % d == 0:
			return 1
		d += 1
	return 0
n = int(input())
a = 4
b = n - 4
for i in range(1, n + 1, 1):
	m = prime(a)
	n = prime(b)
	if n == 1 and m == 1:
		print(a, b)
		break
	else:
		a += 1
		b -= 1


import math
n = int(input())
if n % 2 == 1:
	print(str(n - 9) + ' 9')
else:
	print(str(n - 4) + ' 4')


import sys
import math

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
for i in range(4, n - 4):
	if isPrime(i) == False and isPrime(n - i) == False:
		print(str(i) + ' ' + str(n - i))
		sys.exit()


num = int(input())
if num % 2 == 0:
	print(str(num - 4) + ' ' + str(4))
else:
	print('9 ' + str(num - 9))


n = int(input())
print(' '.join(['9', str(n - 9)]) if n % 2 else ' '.join(['8', str(n - 8)]))


n = int(input())
t = 2
p = 1
if n % t == 0:
	p *= t
	n //= 2
	print(2 * (n - 2), 2 * 2)
else:
	t = 3
	while t ** 2 <= n:
		if n % t == 0:
			n //= t
			p *= t
			break
		t += 2
	if p != 1:
		print(p * (n - 2), p * 2)
	else:
		print(9, n - 9)


def isprime(n):
	if n > 1:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return False
		else:
			return True
	return False
n = int(input())
a = 4
b = 0
while a < int(n / 2 + 1):
	b = n - a
	if not isprime(a) and (not isprime(b)):
		break
	else:
		a += 1
print(a, b)


def prime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
a = n - 4
b = 4
while prime(a) or prime(b):
	a -= 1
	b += 1
print(str(a) + ' ' + str(b))


n = int(input())
if n % 2 == 0:
	print(n - 4, 4)
elif n > 20:
	print(n - (n % 10 + 5), n % 10 + 5)
else:
	print(n - (n % 10 + 1), n % 10 + 1)


def isCom(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
for i in range(int(n / 2) + 1):
	if isCom(i) and isCom(n - i):
		print(str(i) + ' ' + str(n - i))
		break


n = int(input())
x = 0
y = 0
for i in range(n):
	a = i
	b = n - i
	for j in range(i):
		if a % (j + 1) == 0 and j + 1 != a and (j + 1 != 1):
			x = 1
	for h in range(i):
		if b % (h + 1) == 0 and h + 1 != b and (h + 1 != 1):
			y = 1
	if x == 1 and y == 1:
		print(a, b)
		break
	x = 0
	y = 0


a = int(input())
g = a % 2 * 5 + 4
print(g, a - g)


import random
n = int(input())

def heshu(a):
	for i in range(2, a):
		if a % i == 0:
			return 1
			break
for x in range(3, n):
	y = n - x
	if heshu(x) == 1 and heshu(y) == 1:
		print(x, y, end='')
		break


def is_primes(number):
	is_prime = True
	for i in range(2, number):
		if number % i == 0:
			is_prime = False
			break
	return is_prime
input_s = int(input())
for i in range(input_s // 2, 3, -1):
	if not is_primes(i) and (not is_primes(input_s - i)):
		print('{} {}'.format(i, input_s - i))
		break


from math import sqrt
num = int(input())

def prime(value):
	for i in range(2, int(sqrt(value)) + 1):
		if value % i == 0:
			return False
	return True
for i in range(1, num // 2 + 1):
	a = i
	b = num - i
	if not prime(a) and (not prime(b)):
		print(a, b)
		exit(0)


def check(a):
	for i in range(2, int(a / 2) + 1):
		if a % i == 0:
			return True
	return False

def main():
	n = int(input())
	for i in range(2, int(n / 2) + 1):
		if check(i):
			y = n - i
			if check(y):
				print(i, y)
				break
main()


def solve():
	n = int(input())

	def pri(k):
		for i in range(2, k // 2 + 1):
			if k % i == 0:
				return True
		return False
	for i in range(4, n // 2 + 1):
		if pri(i) and pri(n - i):
			print(str(i) + ' ' + str(n - i))
			return
solve()


Y = int(input(''))
if Y % 2 == 0:
	print(Y - 4)
	print(4)
if Y % 2 == 1:
	print(Y - 9)
	print(9)


n = int(input())
if n % 4 == 0:
	print(4, n - 4)
elif n % 4 == 1 or n % 4 == 3:
	print(9, n - 9)
else:
	print(6, n - 6)


(n, k, a) = (int(input()), 0, [])
for i in range(2, n - 1):
	if i != 2 and i != 3 and ((i + 1) % 6 != 0) and ((i - 1) % 6 != 0) and (n - i != 1) and (n - i != 3) and ((n - i + 1) % 6 != 0) and ((n - i - 1) % 6 != 0) and (n - i != 2):
		print(i, n - i)
		break


import sys
n = int(input())
for i in range(4, n):
	for j in range(4, n):
		if j + i == n:
			if (i % 2 == 0 or i % 3 == 0) and (j % 2 == 0 or j % 3 == 0):
				print(i, end=' ')
				print(j)
				sys.exit()


primes = list()

def primeSieve(bound):
	bound += 1
	numbers = [True] * bound
	for i in range(2, bound):
		if numbers[i]:
			for d in range(i * 2, bound, i):
				numbers[d] = False
	for i in range(2, bound):
		if numbers[i]:
			primes.append(i)
n = int(input())
primeSieve(n)
for i in range(4, n):
	if not primes.__contains__(i) | primes.__contains__(n - i):
		print('{} {}'.format(i, n - i))
		break


def soe(m):
	n = 1000000
	n = n + 1
	p = [1] * n
	(p[0], p[1]) = (0, 0)
	n1 = int(n ** 0.5)
	for i in range(2, n1):
		if p[i] == 1:
			for j in range(i * i, n, i):
				p[j] = 0
	for i in range(m, n + 1):
		if p[i] == 1:
			return True
		else:
			return False
n = int(input())
k = 4
n = n - 4
while n > 3:
	if soe(n) != True:
		print(n, k)
		break
	else:
		k = k + 2
		n = n - 2


import math

def isPrime(n):
	if n % 2 == 0:
		return False
	for i in range(3, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
x = y = n // 2
if x + y == n and (not isPrime(x)):
	print(x, y, sep=' ')
	exit(0)
while x > 1:
	y = n - x
	if not isPrime(x) and (not isPrime(y)):
		print(x, y, sep=' ')
		exit(0)
	x -= 1


def iin():
	return int(input())

def sin():
	return input()

def min():
	return map(int, input().strip().split(' '))

def msin():
	return map(str, input().strip().split(' '))

def lin():
	return list(mi())

def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i += 6
	return True
n = iin()
if n % 2 != 0:
	print(n - 9, 9)
else:
	print(n - 8, 8)


n = int(input())
from math import sqrt

def e_prim(k):
	if k == 1:
		return False
	for d in range(2, int(sqrt(n)) + 1):
		if k % d == 0:
			return False
	return True
if n % 2 == 0:
	print(n - 4, 4)
else:
	k = 4
	while e_prim(n - k) == True:
		k = k + 2
	print(k, n - k)


z = int(input())

def is_prime(n):
	if n == 2:
		return True
	if n == 3:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True
a = 4
while a < z:
	if is_prime(z - a):
		a += 1
	elif is_prime(a):
		a += 1
	else:
		break
print(a, z - a)


N = int(input())

def CheckPrime(X):
	for i in range(2, X // 2 + 1):
		if X % i == 0:
			return False
	return True
if CheckPrime(N - 4) == False:
	print(N - 4, 4)
elif CheckPrime(N - 6) == False:
	print(N - 6, 6)
else:
	print(N - 8, 8)


def main():
	N = int(input())
	if N % 2 == 0:
		print(8, N - 8)
	else:
		print(9, N - 9)
main()


n = int(input())
k = 0
for i in range(1, n):
	if i % 4 == 0 or i % 9 == 0:
		k = n - i
		if k % 2 == 0:
			print(i, k, end='')
			break


x = int(input())
sieve = [None] * x
sieve[1] = True
for i in range(2, x):
	if sieve[i] == None:
		for j in range(i * i, x, i):
			sieve[j] = True
for i in range(2, x):
	if sieve[i] == True and sieve[x - i] == True:
		print(i, x - i)
		break


n = int(input())
if (n - 8) % 2 == 0 or (n - 8) % 3 == 0:
	print(8, n - 8)
elif (n - 9) % 2 == 0 or (n - 9) % 3 == 0:
	print(9, n - 9)


n = int(input())
if n % 2 == 0:
	aa = n - 4
	print(str(4) + ' ' + str(aa))
else:
	aa = n - 9
	print(str(9) + ' ' + str(aa))


def pr(n, prime):
	p = 2
	while p ** 2 <= n:
		if prime[p] == True:
			for i in range(2 * p, n + 1, p):
				prime[i] = False
		p += 1
n = int(input())
prime = [True] * (n + 10)
pr(n, prime)
for i in range(4, n // 2 + 1):
	if prime[i] == False and prime[n - i] == False:
		print(i, end=' ')
		print(n - i, end=' ')
		break


import sys

def solve():
	n = int(input())
	if n % 2 == 0:
		print(4, n - 4)
		return
	else:
		print(9, n - 9)
		return
solve()


from math import sqrt
from itertools import count, islice

def isPrime(n):
	return n > 1 and all((n % i for i in islice(count(2), int(sqrt(n) - 1))))

def isPrime2(n):
	if n < 2:
		return False
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def twoCompositeNum(a):
	num1 = num2 = 0
	for i in range(4, a // 2 + 1):
		if not isPrime(i) and (not isPrime(a - i)):
			num1 = i
			num2 = a - i
			break
	print(num1, ' ', num2)

def main():
	n = int(input())
	twoCompositeNum(n)
main()


n = int(input())

def pr(n):
	pn = set()
	n = int(n)
	mark = [True for i in range(n + 2)]
	for p in range(2, int(n ** 0.5) + 2):
		if mark[p] == True:
			for i in range(p ** 2, n + 2, p):
				mark[i] = False
		p += 1
	for p in range(2, n + 1):
		if not mark[p]:
			pn.add(p)
	return pn
p = pr(n)
for i in p:
	if n - i in p:
		print(*[i, n - i])
		break


def isprime(n):
	ctr = 0
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			ctr += 1
		if ctr > 0:
			return 1
	return 0
n = int(input())
if n % 4 == 0:
	print(n // 2, n // 2)
elif n % 2 == 0:
	print(n // 2 - 1, n // 2 + 1)
else:
	for i in range(4, n - 2):
		if isprime(i) == 0:
			continue
		if isprime(n - i) == 0:
			continue
		print(i, n - i)
		break


n = int(input())
a = [4, 6, 8, 9, 10, 12]
count = 0
for i in a:
	if count > 0:
		break
	for j in range(2, 20):
		if (n - i) % j == 0 and n - i != j:
			count += 1
			print(i, n - i)
			break


import math
import sys

def isP(n):
	if n < 3:
		return True
	a = int(math.ceil(math.sqrt(n)))
	for i in range(2, a + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(n - 1, 1, -1):
	if not isP(i):
		for j in range(2, n - 1):
			if not isP(j):
				if j + i == n:
					print(str(j), str(i))
					sys.exit(0)
				elif j + i > n:
					break


n = int(input())

def prime(n):
	seive = [1] * (n + 1)
	seive[0] = 0
	seive[1] = 0
	for i in range(2, n // 2 + 1):
		for j in range(i * i, n + 1, i):
			seive[j] = 0
	return seive[n]
if n & 1 == 0:
	m = n // 2
	q = n - m
	while prime(m) == 1 or prime(q) == 1:
		m -= 1
		q += 1
	print(m, q)
else:
	m = n // 2
	q = n - m
	while prime(m) == 1 or prime(q) == 1:
		m -= 1
		q += 1
	print(m, q)


def primecheck(x):
	count = 0
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			count += 1
			break
	if count:
		return 1
	else:
		return 0
n = int(input())
for i in range(4, n):
	if primecheck(i) == 1 and primecheck(n - i) == 1:
		print(str(i) + ' ' + str(n - i))
		break


from math import sqrt

def divisor(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False

def hypothesis(m):
	for i in range(2, m + 1):
		if divisor(i) and divisor(m - i):
			return (i, m - i)
	return 0
print(*hypothesis(int(input())))


tmp = int(input())
if tmp % 2 == 0:
	print(6, tmp - 6)
else:
	print(9, tmp - 9)


def prime(num):
	for i in range(2, num // 2 + 1):
		if num % i == 0:
			return True
	return False
n = int(input())
a = 2
n -= 2
while True:
	if prime(a) and prime(n):
		print(a, n)
		break
	else:
		a += 1
		n -= 1


n = int(input())
if n % 2 == 0:
	ans = n - 8
else:
	ans = n - 9
print(ans, n - ans)


x = int(input())
a = 0
for i in range(4, x + 1):
	for j in range(x, i, -1):
		if i + j == x:
			if (i % 2 == 0 and j % 2 == 0 or (i % 3 == 0 and j % 3 == 0) or (i % 2 == 0 and j % 3 == 0) or (i % 3 == 0 and j % 2 == 0)) and i >= 4:
				print(f'{i} {j}')
				a = a + 1
				break
		if a == 1:
			break
	if a == 1:
		break


p = 10 ** 6 + 2

def Sieve():
	l = [True] * p
	i = 2
	while i * i <= p:
		if l[i]:
			for j in range(2 * i, p, i):
				l[j] = False
		i += 1
	l[0] = l[1] = False
	return l
isprime = Sieve()
n = int(input())
for i in range(4, n):
	if not isprime[i] and (not isprime[n - i]):
		print(i, n - i)
		break


n = int(input())
x = 0
if n % 2 == 0:
	y = 6
	x = n - y
else:
	y = 9
	x = n - 9
print(x, y)


def prime(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return 1
	return 0
t = int(input())
for i in range(2, t):
	d = prime(i)
	if d == 1:
		k = t - i
		l = prime(k)
		if l == 1:
			print(i, k)
			break


n = int(input())

def iscomposite(n):
	c = 0
	for i in range(2, n - 1):
		if n % i == 0:
			c = c + 1
			break
	return c
for i in range(1, n // 2 + 1):
	if iscomposite(i) == 1 and iscomposite(n - i) == 1:
		print(int(i), int(n - i))
		break


def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	return prime
primes = generate_primes(pow(10, 6))
n = int(input())
for i in range(4, n):
	if not (primes[i] or primes[n - i]):
		print(i, n - i)
		break


import math

def isprime(n):
	for j in range(2, int(math.sqrt(n)) + 1):
		if n % j == 0:
			return 0
	else:
		return 1
x = int(input())
for i in range(x):
	if isprime(i + 1) == 0:
		a = x - i - 1
		if isprime(a) == 0:
			print(i + 1, a)
			break


import math
import os
import sys
import re
import itertools
import functools
import operator
N = int(input())
if N % 2 == 0:
	print('%d %d' % (4, N - 4))
else:
	print('%d %d' % (9, N - 9))


def main():
	from sys import stdin, stdout
	from math import floor, sqrt

	def check(n):
		if n == 2:
			return True
		elif n & 1:
			for i in range(3, floor(sqrt(n)) + 1):
				if n % i == 0:
					return False
			return True
		else:
			return False
	n = int(stdin.readline())
	i = 4
	while True:
		if check(n - i) or check(i):
			i += 1
			continue
		else:
			stdout.write(str(i) + ' ' + str(n - i))
			break
main()


num = int(input())
if not num % 4:
	print(f'{int(num * 0.5)} {int(num * 0.5)}')
elif not num % 2:
	print(f'4 {num - 4}')
else:
	print(f'9 {num - 9}')


from math import sqrt
prime = [True] * 1000001
prime[0] = False
prime[1] = False
for i in range(2, 1000):
	if prime[i]:
		for p in range(i * i, 1000000, i):
			prime[p] = False
N = int(input())
found = False
for i in range(4, N // 2 + 1):
	if prime[i] == False and prime[N - i] == False:
		print(i, N - i)
		break


n = int(input())
flg = 0
lst = [2, 3, 5, 7]
var = 4
while flg == 0:
	rem = n - var
	if (var % 2 == 0 or var % 3 == 0 or var % 5 == 0 or (var % 7 == 0)) and var not in lst:
		if rem % 2 == 0 or rem % 3 == 0 or rem % 5 == 0 or (rem % 7 == 0):
			flg = 1
		else:
			var += 1
	else:
		var += 1
print(var, rem)


a = int(input())

def check(a):
	for i in range(2, a):
		if a % i == 0:
			return 1
	return 0
for i in range(3, a):
	if check(i) == 1 and check(a - i) == 1:
		print(i, a - i)
		break


def Solution(n):
	if n % 2 == 0:
		return '8 %d' % (n - 8)
	else:
		return '9 %d' % (n - 9)
n = int(input())
print(Solution(n))


def check(a):
	global flag
	for i in range(2, a // 2 + 1):
		if a % i == 0:
			flag = 'notprime'
			break
		else:
			flag = 'prime'
	return flag
val = int(input())
flag = 'prima'
k = val // 2
l = val - k
while check(k) == 'prime' or check(l) == 'prime':
	if check(l) == 'prime' or check(k) == 'prime':
		k += 1
		l -= 1
	else:
		break
print(k, l)


def isPrime(n):
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
x = 0
y = 0
while x + y <= n:
	x += 1
	y = n - x
	if not isPrime(x) and (not isPrime(y)):
		print(x, y)
		break


a = int(input())
print(a % 2 * 9 + (a + 1) % 2 * 4, a - (a % 2 * 9 + (a + 1) % 2 * 4))


def isPrime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True

def findComposites(n):
	if n % 2 == 0:
		first_num = n // 2
		second_num = n // 2
	elif n % 2 == 1:
		first_num = n // 2
		second_num = n // 2 + 1
	while isPrime(first_num) or isPrime(second_num) or first_num == 1 or (second_num == 1):
		first_num -= 1
		second_num += 1
	print(first_num)
	print(second_num)
x = int(input())
findComposites(x)


n = int(input())
print(['9' + ' ' + str(n - 9), '8' + ' ' + str(n - 8)][n % 2 == 0])


a = int(input().strip())
if a % 2 == 0:
	print('8', a - 8)
else:
	print('9', a - 9)


n = int(input())
i = 2
if n % 2 == 0:
	print(4, n - 4)
else:
	while True:
		i += 2
		if (n - i) % 3 == 0:
			print(i, n - i)
			break


import math

def bs(ar, l, h, t, i):
	if l > h:
		return -1
	m = (l + h) // 2
	if i + ar[m] == t:
		return ar[m]
	elif i + ar[m] < t:
		return bs(ar, m + 1, h, t, i)
	else:
		return bs(ar, l, m - 1, t, i)
t = int(input())
cp = [0] * t
for i in range(2, int(math.sqrt(t)) + 1):
	if cp[i] != 1:
		for j in range(i * i, t, i):
			cp[j] = 1
ar = []
ap = ar.append
for i in range(t):
	if cp[i] != 0:
		ap(i)
for i in ar:
	val = bs(ar, 0, len(ar), t, i)
	if val != -1:
		print(i, val)
		break


n = int(input())
n1 = 8
n2 = n - 8

def prime(n):
	if n % 2 == 0:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True
if prime(n2):
	n1 += 1
	n2 -= 1
print(f'{n1} {n2}')


import sys
from bisect import bisect_left, bisect_right
from collections import deque, Counter
from math import gcd, sqrt, factorial
from itertools import permutations
inf = float('inf')
mod = 1000000007
mini = 1000000007

def fact(n):
	if n == 0:
		return 1
	p = 1
	d = 10 ** 9 + 7
	for i in range(1, n + 1):
		p = p * i
		p = p % d
	return p

def ncr(n, r):
	d = 10 ** 9 + 7
	num = fact(n)
	den = fact(r) * fact(n - r) % d
	den = pow(den, d - 2, d)
	return num * den % d

def sieve(n):
	myset = set()
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p = p + 1
	for i in range(2, n + 1):
		if prime[i]:
			myset.add(i)
	return myset

def binary(number):
	result = 0
	while number:
		result = result + 1
		number = number & number - 1
	return result

def calculate_factors(n):
	hh = [1] * (n + 1)
	p = 2
	while p * p < n:
		if hh[p] == 1:
			for i in range(p * 2, n, p):
				hh[i] = 0
		p += 1
	total = 1
	for p in range(2, n + 1):
		if hh[p] == 1:
			count = 0
			if n % p == 0:
				while n % p == 0:
					n = int(n / p)
					count += 1
				total *= count + 1
	return total

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
myset = sieve(1000007)
n = int(input())
start = 4
end = 1000000
while start < end:
	calc = start + end
	if calc == n:
		print(start, end)
		break
	elif calc < n:
		start = start + 1
		while start in myset:
			start = start + 1
	else:
		end = end - 1
		while end in myset:
			end = end - 1


def res(n):
	if n % 2 == 0:
		print(4, n - 4)
	else:
		print(9, n - 9)
n = int(input())
res(n)


n = int(input())

def composite(x):
	for i in range(2, x):
		if x % i == 0:
			return True
			break
for i in range(3, n - 2):
	if composite(i) and composite(n - i):
		print(*[i, n - i])
		break


import math

def prime(n):
	if n == 2:
		return True
	elif n % 2 == 0 or n == 1:
		return False
	else:
		for i in range(3, math.floor(math.sqrt(n)) + 1, 2):
			if n % i == 0:
				return False
		return True
n = int(input())
c = 4
s = 1
while s:
	if not prime(c):
		if not prime(n - c):
			print(c, n - c)
			s = 0
		else:
			c += 1
	else:
		c += 1


def urok(chislo):
	if chislo % 2 == 0 and chislo >= 12:
		return (8, chislo - 8)
	elif chislo % 2 != 0 and chislo >= 12:
		return (9, chislo - 9)
(a, b) = urok(int(input()))
print(a, b)


n = int(input())
if n % 2 == 0:
	print(n - 4, 4)
else:
	a = n // 2
	b = a + 1
	while a % 3 != 0 or b % 2 != 0:
		a += 1
		b -= 1
	print(a, b)


def prime(n):
	c = 0
	for i in range(1, n):
		if n % i == 0:
			c += 1
	if c == 1:
		return True
	else:
		return False
n = int(input())
z = 0
for i in range(4, n):
	for j in range(4, n):
		if i + j == n:
			if prime(i) == False and prime(j) == False:
				print(i, j)
				z = 1
				break
	if z == 1:
		break


lt = [False] * 1000001
(lt[0], lt[1]) = (False, False)
for i in range(2, 1000001):
	if not lt[i]:
		for x in range(2 * i, 1000001, i):
			lt[x] = True
x = int(input())
for i in range(x // 2 + 1):
	if lt[i] and lt[x - i]:
		print(i, x - i)
		break


n = int(input())
if n % 2 == 0 and n / 2 % 2 == 0:
	print(int(n / 2), int(n / 2))
elif n % 2 == 0 and n / 2 % 2 == 1:
	print(int((n - 1) / 2), int((n + 3) / 2))
elif n % 2 == 1:
	i = 4
	no = n - 4
	while i + no == n:
		if i % 2 == 0 and no % 3 == 0 or (no % 2 == 0 and i % 3 == 0):
			break
		i += 1
		no -= 1
	print(i, no)


def isComposite(m):
	if m <= 3:
		return 0
	elif m % 3 == 0 or m % 2 == 0:
		return 1
	i = 5
	while i * i <= m:
		if m % i == 0 or m % (i + 2) == 0:
			return 1
		i += 6
	return 0
n = int(input())
for i in range(4, n):
	if i + (n - i) == n and isComposite(i) and isComposite(n - i):
		print(i, n - i)
		break


def is_prime(n):
	if n == 2 or n == 3:
		return True
	if n % 3 == 0 or n % 2 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i += 6
	return True
n = int(input())
composites = [4, 6, 8, 9, 10]
for c in composites:
	if not is_prime(n - c):
		print(c, n - c)
		break


n = int(input())

def prime(n):
	count = 0
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			count += 1
			break
	if count == 0 and n != 1:
		return 1
	else:
		return 0
if n % 2 == 0:
	j = 1
	a = n // 2
	b = n // 2
	while j != 0:
		if prime(a) or prime(b):
			a -= 1
			b += 1
		else:
			print(a, b)
			j = 0
else:
	a = n // 2
	b = a + 1
	j = 1
	while j != 0:
		if prime(a) or prime(b):
			a -= 1
			b += 1
		else:
			print(a, b)
			j = 0


import math

def is_simple(n: int):
	for i in range(2, math.ceil(pow(n, 0.5)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n - 3):
	if not is_simple(i) and (not is_simple(n - i)):
		print(i, n - i)
		break


n = int(input())
i = 4
lst = list()
while i <= n - 4:
	a = i
	b = n - a
	if a % 2 == 0 and b % 3 == 0:
		break
	elif a % 3 == 0 and b % 2 == 0:
		break
		lst.append(a)
		lst.append(b)
		lst.append(a)
		lst.append(b)
	elif a % 2 == 0 and b % 5 == 0:
		break
	elif a % 3 == 0 and b % 5 == 0:
		break
	i = i + 1
print(a, b)


import math

def prime(num):
	s = []
	sq = math.sqrt(num)
	for i in range(1, int(sq) + 2):
		if num % i == 0:
			s.append(i)
	if num == 1:
		return False
	elif num == 2:
		return True
	elif len(s) == 1:
		return True
	else:
		return False
n = int(input(''))
for t in range(2, n + 1):
	if prime(t) is False and prime(n - t) is False:
		print(t, n - t, end=' ')
		break


k = int(input())
if k % 2 == 0 and k / 2 % 2 == 0:
	print(str(k // 2) + ' ' + str(k // 2))
	exit(0)
elif k % 2 == 0:
	print(str(k // 2 + 1) + ' ' + str(k // 2 - 1))
	exit(0)
else:
	print('9 ' + str(k - 9))


def prime(p):
	fac = 0
	if p == 1:
		return False
	elif p == 2:
		return True
	for i in range(2, p + 1):
		if p % i == 0:
			fac += 1
	if fac == 1:
		return True
	else:
		return False
n = int(input())
for k in range(4, n):
	if not prime(k):
		if not prime(n - k):
			print(str(k) + ' ' + str(n - k))
			break


import math

def composite(p):
	s = math.sqrt(p)
	for i in range(2, int(s) + 1):
		if p % i == 0:
			return False
	return True
n = int(input())
flag = True
for i in range(2, n):
	for j in range(2, n):
		if not composite(i) and (not composite(j)):
			if j + i != n:
				flag = True
			else:
				flag = False
				break
	if not flag:
		break
print(i, ' ', j)


r = int(input())
if r % 2 == 0:
	print(r - 4, 4)
else:
	print(r - 9, 9)


import sys, math
isprime = [0] * 1000010

def seive():
	isprime[1] = isprime[0] = 1
	limit = int(math.sqrt(1000010)) + 2
	for i in range(4, 1000010, 2):
		isprime[i] = 1
	for i in range(3, 1000010, 2):
		if not isprime[i]:
			if i <= limit:
				for j in range(i * i, 1000010, i * 2):
					isprime[j] = 1
seive()
n = int(input())
i = 4
while True:
	x = n - i
	if isprime[x] and isprime[i]:
		print(i, x)
		break
	i += 1


from math import sqrt
m = pow(10, 6)
a = [False] * (m + 1)

def sieve():
	l = int(sqrt(m)) + 1
	for i in range(2, l):
		if a[i] == False:
			for j in range(i ** 2, m + 1, i):
				a[j] = True
sieve()
n = int(input())
for i in range(4, n):
	if a[i] and a[n - i]:
		print(i, n - i)
		break


def iscomposite(n):
	if n < 4:
		return False
	for i in range(2, int(n / 2) + 1):
		if n % i == 0:
			return True
	return False
number = int(input())
for i in range(int(number / 2) + 1):
	if iscomposite(i) and iscomposite(number - i):
		print(i, number - i)
		break


def compuesto(n):
	if n % 2 == 0:
		return True
	else:
		d = int(n ** 0.5 + 1)
		for i in range(3, d, 1):
			if n % i == 0:
				return True
		else:
			return False
n = int(input())
d = 4
t = n - d
while True:
	if compuesto(d) and compuesto(t):
		break
	else:
		d += 1
		t -= 1
print('{0} {1}'.format(d, t))


number = int(input())
i = 4
while True:
	another = number - i
	prime = True
	for n in range(2, i):
		if i % n == 0:
			prime = False
			break
	for j in range(2, another):
		if another % j == 0 and prime == False:
			print(i, another)
			quit()
	i += 1


num = int(input())
primes = [True] * 1000003
primes[1] = False
for i in range(2, 1000003, 1):
	if primes[i] == True:
		for j in range(2 * i, 1000003, i):
			primes[j] = False
for i in range(2, num, 1):
	if primes[i] == False and primes[num - i] == False:
		print('%d %d' % (i, num - i))
		break


n = int(input())
j = 10 ** 6
prime = [True for i in range(j + 1)]
prime[0] = False
prime[1] = False
p = 2
o = []
while p <= j:
	if prime[p] == True:
		o.append(p)
		for i in range(p * p, j + 1, p):
			prime[i] = False
	p += 1
for i in range(2, n + 1):
	if i not in o:
		if n - i not in o:
			print(i, n - i)
			break


import math

def isComposite(x):
	c = 0
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			c += 1
	if c != 0:
		return True
	else:
		return False
n = int(input())
for i in range(4, n):
	if isComposite(i) and isComposite(n - i):
		print(i, n - i)
		break


n = int(input())
p = 0

def com(x):
	t = 0
	global p
	for i in range(2, x):
		if x % i != 0:
			t += 1
	if t == x - 2:
		p += 1
for i in range(4, n):
	l = i
	m = n - i
	com(l)
	com(m)
	if p == 0:
		break
	else:
		p = 0
		l += 1
		m -= 1
print(l, m)


n = int(input())
x = n // 2
y = n - x
while not ((x % 3 == 0 or x % 2 == 0) and (y % 3 == 0 or y % 2 == 0)):
	x -= 1
	y += 1
print(x, y)


n = int(input())
flag = 0
if n % 2 == 0:
	print(4, n - 4)
else:
	for i in range(2, n):
		if i % 2 != 0:
			for j in range(2, i // 2):
				if i % j == 0:
					flag = 1
					break
		if flag == 1:
			break
	print(i, n - i)


from math import sqrt

def isPrime(x):
	for i in range(2, int(sqrt(x) + 1)):
		if x % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n):
	if not isPrime(i):
		j = n - i
		if not isPrime(j):
			print(i, ' ', j)
			break


def is_prime_number(x):
	if x >= 2:
		for y in range(2, x):
			if not x % y:
				return False
	else:
		return False
	return True
n = int(input())
s = 0
f = 0
for i in range(n - 1, 0, -1):
	if is_prime_number(i) is True:
		continue
	else:
		s = n - i
		if is_prime_number(s) is True or s == 1:
			continue
		else:
			f = i
			break
print(s, f)


x = int(input())
if x % 2 == 0:
	a = str(4)
	b = str(x - 4)
else:
	a = str(9)
	b = str(x - 9)
output = a + ' ' + b
print(output)


def is_prime(x):
	if x < 2:
		return False
	xx = int(x ** 0.5)
	for i in range(2, xx + 1):
		if x % i == 0:
			return False
	return True
n = int(input())
for i in range(2, n):
	if not is_prime(i) and (not is_prime(n - i)):
		print(i, n - i)
		break


n = int(input())
if n % 2 == 0:
	j = n - 4
	print('4', j)
else:
	j = n - 9
	print('9', j)


from math import sqrt

def check(a):
	if a == 1:
		return True
	elif a == 2:
		return True
	elif a % 2 == 0:
		return True
	else:
		for i in range(3, int(sqrt(a)) + 1, 2):
			if a % i == 0:
				return True
	return False
a = int(input())
if a % 2 == 0:
	x = a / 2
	y = a / 2
else:
	x = a // 2
	y = a - x
while True:
	if check(x) and check(y):
		print(int(x), int(y))
		break
	else:
		x -= 1
		y += 1


input_number = int(input())
value = input_number % 2 + 8
print(value, input_number - value)


n = int(input())
is_prime = [True for _ in range(n)]
for i in range(2, int(n ** 0.5 + 1)):
	if not is_prime[i]:
		continue
	for j in range(i ** 2, n, i):
		is_prime[j] = False
for i in range(4, n, 2):
	if not is_prime[n - i]:
		print(i, n - i)
		break


import math

def p(x):
	if x == 1:
		return 0
	elif x != 2 and x & 1 == 0:
		return 0
	elif x == 2:
		return 1
	else:
		k = int(x ** 0.5) + 1
		for i in range(3, k):
			if x % i == 0:
				return 0
		return 1
n = int(input())
for i in range(4, n // 2 + 1):
	if p(i) == 0 and p(n - i) == 0:
		print(i, n - i)
		break


n = int(input())

def funct(n):
	if n % 2 == 0:
		print(4, n - 4)
	else:
		print(n - 9, n - (n - 9))
funct(n)


cip = int(input())
z = int(cip / 2)
if cip % 2 == 0:
	print(4, cip - 4)
else:
	print(9, cip - 9)


def isco(x):
	for i in range(2, x):
		if x % i == 0:
			return True
			break
n = int(input())
if n % 2 == 0:
	x = n - 4
	print('4' + ' ' + str(x))
else:
	for i in range(2, int(n / 2)):
		x = n - 2 * i
		if isco(x):
			print(str(2 * i) + ' ' + str(x))
			break


def prime(n):
	f = 1
	for i in range(2, n, 1):
		if n % i == 0:
			f = 0
			break
	return f
n = int(input())
for j in range(4, n, 1):
	if prime(j) != 1 and prime(n - j) != 1:
		print(j, n - j)
		break


def composite(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
n = int(input())
f = 1
for i in range(n // 2, 3, -1):
	if composite(i) and composite(n - i):
		print(i, n - i)
		break


a = int(input())
c = 0
pr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
while a % pr[c] != 0:
	c += 1
	if c == 168:
		c -= 1
		break
if pr[c] < a and a % pr[c] == 0:
	print(str(pr[c] * 2) + ' ' + str(a - pr[c] * 2))
else:
	c = 4
	while True:
		if c not in pr and a - c not in pr:
			print(str(c) + ' ' + str(a - c))
			break
		c += 1


n = int(input())
b = [True for i in range(n + 1)]
for i in range(2, n + 1):
	if b[i] == True:
		for g in range(i + i, n + 1, i):
			b[g] = False
for i in range(2, n + 1):
	if b[i] == False:
		c = n - i
		if b[c] == False:
			print(i, c)
			break


import sys
import math
n = int(sys.stdin.readline())
if n % 2 == 0:
	if int(n / 2) % 2 == 0:
		s = str(int(n / 2))
		print(s + ' ' + s)
	else:
		k = int(n / 2)
		print(str(k + 1) + ' ' + str(k - 1))
else:
	print(str(n - 9) + ' ' + str(9))


def isComp(num):
	for i in range(2, num):
		if num % i == 0:
			return True
	return False
n = int(input())
a = n - 4
b = 4
for i in range(n):
	if isComp(a) and isComp(b):
		print(a, b)
		break
	else:
		a -= 1
		b += 1


n = int(input())
a = 4
b = n - a
x = False
y = False
while a < n:
	for j in range(2, a):
		if a % j == 0:
			x = True
	for j in range(2, b):
		if b % j == 0:
			y = True
	if x == True and y == True:
		break
	else:
		a += 1
		b = n - a
		x = False
		y = False
l = [a, b]
for i in l:
	print(i, end=' ')


number = int(input())
if number >= 12 and number % 2 == 0:
	print(8, number - 8)
elif number >= 12 and number % 2 != 0:
	print(9, number - 9)


def complex(n):
	i = 1
	a = []
	while i <= n // 2:
		if n % i == 0:
			a.append(i)
		i += 1
	else:
		a.append(n)
	if len(a) > 2:
		return True
	else:
		return False

def goldbach(i):
	a = 4
	b = i - a
	while a <= b:
		if complex(a) and complex(b):
			return (a, b)
		else:
			a += 1
			b -= 1
a = goldbach(int(input()))
for i in a:
	print(i, end=' ')


n = int(input())
(a, b) = (0, 0)

def checkPrime(num):
	if num == 5 or num == 7:
		return True
	if num % 2 == 0:
		return False
	if sum([int(i) for i in str(num)]) % 3 == 0:
		return False
	if num % 5 == 0:
		return False
	for i in range(7, int(num ** 0.5) + 1, 2):
		if num % i == 0:
			return False
	return True
for i in range(4, n // 2 + 1):
	if not checkPrime(i) and (not checkPrime(n - i)):
		(a, b) = (i, n - i)
		break
print(a, b)


n = int(input())

def sos(n):
	d = 2
	for i in range(n):
		if n > 2:
			if n % d == 0 and d != n:
				return True
			elif n == i + 1:
				return False
		else:
			return False
		d += 1
d = 4
x = n - d
while True:
	if sos(x) and sos(d) and (d != n) and (x > 3):
		print(x, d)
		break
	else:
		d += 1
		x = n - d


n = int(input())
i = n % 2 + 8
print(i, n - i)


n = int(input())
ans1 = n % 2 + 8
ans2 = n - ans1
print('{0} {1}'.format(ans1, ans2))


def isComposite(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
number = int(input())
smallestComposite = 4
rngNumbers = list(range(smallestComposite, number + 1 - smallestComposite))
foundTheAnswer = False
while foundTheAnswer is not True:
	num = rngNumbers[0]
	if isComposite(num):
		if isComposite(rngNumbers[len(rngNumbers) - 1]):
			print(num, rngNumbers[len(rngNumbers) - 1])
			foundTheAnswer = True
		else:
			rngNumbers.remove(rngNumbers[len(rngNumbers) - 1])
			rngNumbers.remove(num)
	else:
		rngNumbers.remove(rngNumbers[len(rngNumbers) - 1])
		rngNumbers.remove(num)


def isPrime(num):
	if num <= 1:
		return False
	for i in range(2, num):
		if num % i == 0:
			return False
	return True
n = int(input())
i = 4
while True:
	if not isPrime(i) and (not isPrime(n - i)):
		n1 = i
		n2 = n - i
		break
	i += 1
print(n1, n2)


inp = int(input())
l = []
t = 0
num = 0
bol = True
l.append(inp // 2)
l.append(inp - inp // 2)
while bol:
	for x in range(1, l[num] + 1):
		if l[num] % x == 0:
			t += 1
			if t >= 3:
				break
	if t >= 3:
		num += 1
		t = 0
		if num == 2:
			bol = False
	else:
		num = 0
		t = 0
		l[0] -= 1
		l[1] += 1
print(str(l[0]) + ' ' + str(l[1]))


def iscom(n):
	c = 0
	for i in range(1, n + 1):
		if n % i == 0:
			c += 1
		if c > 2:
			break
	if c > 2:
		return 1
	else:
		return 0
n = int(input())
f = 1
k = n // 2
if n % 2 == 0 and k % 2 == 0:
	print(k, k)
else:
	for i in range(2, n):
		a = i
		b = n - i
		k1 = iscom(i)
		k2 = iscom(n - i)
		if k1 == 1 and k2 == 1:
			break
	print(a, b)


n = int(input())
n1 = n // 2
n2 = n - n1
flag1 = flag2 = 0

def comp(x, y):
	temp1 = x
	temp2 = y
	x = max(temp1, temp2)
	y = min(temp1, temp2)
	return (x, y)

def nod(x, y):
	(x1, y1) = comp(x, y)
	while x1 % y1 != 0:
		(x1, y1) = comp(x1 % y1, y1)
	return y1
while 1:
	for i in range(2, 13):
		if flag1 == 0:
			if nod(n1, i) != 1 and nod(n1, i) != n1:
				flag1 = 1
		if flag2 == 0:
			if nod(n2, i) != 1 and nod(n2, i) != n2:
				flag2 = 1
	if flag1 + flag2 == 2:
		print(n1, n2)
		break
	flag1 = 0
	flag2 = 0
	n2 += 1
	n1 -= 1


def main():
	N = int(input())
	if N % 2 == 0:
		print(4, N - 4)
	else:
		print(9, N - 9)
main()


num = int(input())

def isprime(n):
	n = int(n)
	if n > 1:
		for i in range(2, n):
			if n % i == 0:
				return 0
		else:
			return 1
	else:
		return 0
a = 3
b = num - 3
while 1:
	if isprime(a) == 0 and isprime(b) == 0:
		print(a, b)
		break
	else:
		a += 1
		b -= 1
		continue


import math
n = int(input())
b = 0
lim1 = (n + 1) // 2
for a in range(4, lim1):
	b = n - a
	if a % 2 == 0 and b % 2 == 0:
		print(str(a) + ' ' + str(b))
		exit()
	lim2 = int(math.sqrt(a))
	for l1 in range(2, lim2 + 1):
		if a % l1 == 0:
			lim3 = int(math.sqrt(b))
			for l2 in range(2, lim3 + 1):
				if b % l2 == 0:
					print(str(a) + ' ' + str(b))
					exit()


n = int(input())
res = n % 6
if res == 0 or res == 3:
	print(6, n - 6, sep=' ')
elif res == 1:
	print(9, n - 9, sep=' ')
elif res == 2 or res == 4:
	print(4, n - 4, sep=' ')
else:
	print(8, n - 8, sep=' ')


n = int(input())
(f, f1) = (0, 0)
for i in range(3, n):
	for j in range(2, i):
		if i % j == 0:
			f = 1
			break
	for j in range(2, n - i):
		if (n - i) % j == 0:
			f1 = 1
			break
	if f == 1 and f1 == 1:
		break
	else:
		f = 0
		f1 = 0
print(i, n - i)


n = int(input())
if n % 2 == 0:
	(x, y) = (int(n / 2), int(n / 2))
else:
	x = n // 2
	y = x + 1

def isComposite(num):
	div = [2, 3, 5, 7]
	result = any([num != d and num % d == 0 for d in div])
	return result
while not isComposite(x) or not isComposite(y):
	x -= 1
	y += 1
print(x, y)


n = int(input())
if n % 2 == 0:
	res = n - 8
	print(res, 8)
else:
	res = n - 9
	print(res, 9)


def func(n):
	if n % 2 == 0:
		print(4, n - 4, sep=' ')
	else:
		print(n - 9, n - (n - 9), sep=' ')
n = int(input())
func(n)


def sieve(x):
	global c
	d = [True for i in range(x + 6)]
	i = 2
	j = 0
	while i < x:
		j = 1
		if d[i]:
			while j * i < x:
				d[j * i] = False
				j += 1
			c.append(i)
		i += 1
n = int(input())
c = []
sieve(n + 4)
i = 4
while i * 2 < n:
	b = True
	j = n - i
	for z in c:
		if j == z:
			b = False
			break
	if b:
		break
	i += 2
print(str(i) + ' ' + str(j))


import math
flag = False
n = int(input())
for i in range(2, math.floor(n / 2)):
	for j in range(2, math.floor(n / 2)):
		k = n
		k -= i * j
		for t in range(2, math.floor(n / 2)):
			if k % t == 0:
				flag = True
				break
		if flag == True:
			print(i * j, n - i * j)
			break
	if flag == True:
		break


from math import sqrt

def prime(n):
	t = True
	a = int(sqrt(n)) + 2
	for i in range(2, a):
		if n % i == 0:
			t = False
			break
	return t
n = int(input())
for i in range(4, n + 1):
	if prime(i) != True and prime(n - i) != True:
		print(i, n - i)
		break


a = int(input())
for i in range(4, a - 3):
	for m in range(2, i):
		if i % m == 0:
			for n in range(2, a - i):
				if (a - i) % n == 0:
					print(i, a - i)
					exit()
				else:
					pass
		else:
			pass


n = int(input())
m1 = n % 2 + 8
m2 = n - n % 2 - 8
print(m1, m2)


def avval(n):
	i = 1
	t = 0
	while i <= n:
		if n % i == 0:
			t += 1
		i += 1
		if t > 2:
			break
	if t == 2:
		return 1
	else:
		return 0
a = int(input())
f = a - 2
while f:
	if avval(f) == 0 and (avval(a - f) == 0 and a - f != 1):
		print(a - f, f)
		break
	f -= 1


def func(n):
	n1 = n // 2
	n2 = n - n1
	while n1 % 2 != 0 or n2 % 3 != 0:
		n1 -= 1
		n2 += 1
	print(f'{n1} {n2}')
n = int(input())
func(n)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
primes = [1] * (N + 1)
for i in range(2, N + 1):
	if primes[i]:
		v = i * 2
		while v <= N:
			primes[v] = 0
			v += i
for i in range(N + 1):
	if not primes[i] and (not primes[N - i]):
		print(i, N - i)
		exit(0)


n = int(input())
(a, b) = (0, 0)
for i in range(2, n):
	k = n - 2 * i
	if k % 3 == 0 and k // 3 > 1 or (k % 2 == 0 and k // 2 > 1):
		(a, b) = (i * 2, k)
print(min(a, b), max(a, b))


def judgeifsushu(num):
	for i in range(2, int(pow(num, 0.5) + 1)):
		if num % i == 0:
			return False
	return True
num = int(input())
n = 4
while judgeifsushu(num - n) or judgeifsushu(n):
	n += 1
print(str(n) + ' ' + str(num - n))


from math import sqrt
n = int(input())

def isnotprime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
a = 4
b = n - 4
while isnotprime(b) and b > 1:
	a += 2
	b -= 2
print(a, b)


def isPrime(n):
	if n % 2 == 0:
		return False
	for i in range(3, (n + 1) // 2 + 1, 2):
		if n % i == 0:
			return False
	else:
		return True
a = int(input())
b = a // 2
c = (a + 1) // 2
while True:
	if b + c == a and (not isPrime(b)) and (not isPrime(c)):
		print('{} {}'.format(b, c))
		break
	c += 1
	b -= 1


n = int(input())

def itcompositerprime(n):
	from math import sqrt
	if n < 2:
		return False
	elif n == 2:
		return False
	i = 2
	limit = int(sqrt(n))
	while i <= limit:
		if n % i == 0:
			return True
		i += 1
	return False
i = 4
while i < n - 4:
	a = n - i
	if itcompositerprime(a) and itcompositerprime(i):
		print(i, a)
		break
	i += 1


a = int(input())

def sostav(n):
	if n % 2 == 0:
		return True
	for i in range(3, n, 2):
		if n % i == 0:
			return True
	return False
for i in range(4, a):
	if sostav(i) and sostav(a - i):
		print(i, a - i)
		break


n = int(input())
if (n - 8) % 2 == 0:
	x = 8
	y = n - 8
else:
	x = 9
	y = n - 9
print(x, y)


def fun(n):
	if 2 ** (n - 1) % n == 1:
		return False
	return True
n = int(input())
for i in range(4, n + 1):
	if fun(i) == True and fun(n - i) == True:
		print(i, n - i)
		break


num = int(input())
if num % 2 == 0:
	smolnum = num / 2
	if smolnum % 2 == 0:
		print(int(smolnum), int(smolnum))
	else:
		print(int(smolnum - 1), int(smolnum + 1))
else:
	print(9, num - 9)


def criba(maximo):
	N = [True, True] + [True] * (maximo - 1)
	j = 2
	i = 2
	while j ** 2 <= maximo:
		i += j
		while i <= maximo:
			N[i] = False
			i += j
		r = j + 1
		while r < maximo:
			if N[r]:
				j = r
				break
			r += 1
		i = j
	return [i + 2 for (i, not_crossed) in enumerate(N[2:]) if not_crossed]
n = int(input())
s = criba(n)
i = 2
j = n - 2
while True:
	if i not in s and j not in s:
		print(i, j)
		break
	i += 1
	j -= 1


n = int(input())
for i in range(4, n // 2 + 1):
	x = i
	y = n - i
	a = 0
	b = 0
	for j in range(2, x // 2 + 1):
		if x % j == 0:
			a = 1
			break
	for k in range(2, y // 2 + 1):
		if y % k == 0:
			b = 1
			break
	if a + b == 2:
		print(x, y)
		break


t = int(input())
if t % 2 == 0:
	x = 4
	y = t - 4
else:
	x = 9
	y = t - 9
print(x, y)


n = int(input())
if n % 2 == 0:
	x = 4
else:
	x = 9
y = n - x
a = str(x)
b = str(y)
print(a + ' ' + b)


inp = int(input())
if inp % 2:
	print(inp - 9, 9)
else:
	print(inp - 4, 4)


a = int(input())
l = 4
u = a - l
f1 = 0
f2 = 0
for i in range(0, a):
	for j in range(2, l):
		if l % j == 0:
			f1 = 1
			break
		else:
			f1 = 0
	for j in range(2, u):
		if u % j == 0:
			f2 = 1
			break
		else:
			f2 = 0
	if f1 != 1 or f2 != 1:
		l += 1
		u -= 1
	else:
		break
print(l, u)


from math import sqrt

def Judge(num):
	for i in range(2, int(sqrt(num)) + 1):
		if num % i == 0:
			return 0
	return 1
n = int(input())
x = 4
y = 0
while x <= int(n / 2):
	y = n - x
	if Judge(x) == 0 and Judge(y) == 0:
		print(x, y, end=' ')
		break
	x = x + 1


l1 = int(input())
if l1 % 2 == 0:
	print(str(l1 - 4) + ' 4')
else:
	print(str(l1 - 9) + ' 9')


def is_comp_n(num):
	i = 2
	while i in range(2, int(num ** 0.5) + 1):
		if num % i == 0:
			return True
		i += 1
	return False
n = int(input())
k = 4
while k in range(4, n - 1):
	if all([is_comp_n(k), is_comp_n(n - k)]):
		print('{} {}'.format(k, n - k))
		break
	k += 1


def isPrime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
if n % 4 == 0:
	print('%d %d' % (n // 2, n // 2))
else:
	a = (n + 1) // 2
	b = n // 2
	while isPrime(a) or isPrime(b):
		a += 1
		b -= 1
	print('%d %d' % (a, b))


def isprime(n):
	list = []
	for i in range(1, int(pow(n, 1 / 2)) + 1):
		if n % i == 0:
			list.append(i)
			list.append(n)
		else:
			continue
	if len(list) > 2:
		return False
	elif len(list) == 2:
		return True
n = int(input())
for m in range(2, n // 2 + 1):
	k = n - m
	if isprime(k) == False and isprime(m) == False:
		print(m, ' ', k)
		break
	else:
		continue


def answer():
	k = 0
	a = int(input())
	if a == 13:
		return str(int(a - 4)) + ' ' + str(int(4))
	elif str(a)[-1] == '8':
		ans = str(int(a - 4)) + ' ' + str(int(4))
	elif str(a)[-1] == '6':
		ans = str(int(a - 4)) + ' ' + str(int(4))
	elif str(a)[-1] == '2':
		ans = str(int(a - 4)) + ' ' + str(int(4))
	elif str(a)[-1] == '4':
		ans = str(int(a - 4)) + ' ' + str(int(4))
	elif str(a)[-1] == '5':
		ans = str(int(a - 9)) + ' ' + str(int(9))
	elif str(a)[-1] == '1':
		ans = str(int(a - 6)) + ' ' + str(int(6))
	elif str(a)[-1] == '3':
		ans = str(int(a - 8)) + ' ' + str(int(8))
	elif str(a)[-1] == '7':
		ans = str(int(a - 9)) + ' ' + str(int(9))
	elif str(a)[-1] == '9':
		ans = str(int(a - 9)) + ' ' + str(int(9))
	else:
		ans = str(int(a - 10)) + ' ' + str(int(10))
	return ans
print(answer())


t = int(input())
for i in range(2, t):
	if t % 2 == 0:
		print('4', t - 4, end=' ')
		break
	else:
		print('9', t - 9, end=' ')
		break


import math
N = 10 ** 6 + 1
prime = [True for i in range(N)]
(prime[0], prime[1]) = (False, False)

def SOE():
	p = 2
	while p * p <= N:
		if prime[p] == True:
			for p1 in range(p + p, N, p):
				prime[p1] = False
		p += 1
SOE()
n = int(input())
if n % 4 == 0:
	print(n // 2, n // 2)
else:
	for i in range(2, n // 2 + 1):
		if prime[i] == False and prime[n - i] == False:
			print(i, n - i)
			break


a = int(input())
zugo = 0
for i in range(4, a):
	if i % 2 == 0 or i % 3 == 0:
		if (a - i) % 2 == 0 or (a - i) % 3 == 0:
			print(i, a - i)
			break
		else:
			pass


import math

def is_prime(num):
	if num < 2:
		return False
	if num == 2:
		return True
	if num % 2 == 0:
		return False
	for divisor in range(2, math.floor(math.sqrt(num)) + 1):
		if num % divisor == 0:
			return False
	return True
n = int(input())
for num in range(4, n):
	if not is_prime(num) and (not is_prime(n - num)):
		print(num, n - num)
		break


n = int(input())
if n % 2 == 0:
	print(6, n - 6)
else:
	print(min(9, n - 9), max(9, n - 9))


n = int(input())
for i in range(4, n + 1, 2):
	if (n - i) % 2 == 0:
		n = n - i
		print(n, i)
		break
	elif (n - i) % 3 == 0:
		n = n - i
		print(n, i)
		break


n = int(input())
for i in range(4, n):
	a = i
	b = n - i
	k = (a, b)
	for j in k:
		h = 0
		for z in range(2, j // 2 + 1):
			if j % z == 0:
				h = 1
				break
		if h == 0:
			break
	if h == 1:
		print(a, b)
		break


def composite(n):
	for i in range(2, n - 1):
		if n % i == 0:
			return True
	return False

def math(n):
	for i in range(2, n - 1):
		if composite(i) and composite(n - i):
			return str(i) + ' ' + str(n - i)
n = int(input())
print(math(n))


import math

def is_prime(n):
	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False
	return True

def solve(n):
	if n % 2 == 0:
		a = n - 4
	else:
		for i in range(5, 1000000, 2):
			if not is_prime(i):
				a = i
				break
	return a
n = int(input())
a = solve(n)
print(f'{a} {n - a}')


from math import sqrt
n = int(input())
check_prime = [1] * n
check_prime[0] = check_prime[1] = 0
for i in range(2, int(sqrt(n) + 1)):
	if check_prime[i]:
		for j in range(i * i, n, i):
			check_prime[j] = 0
for i in range(4, n // 2 + 1):
	if not check_prime[i] and (not check_prime[n - i]):
		print(i, n - i)
		break


def is_prime(n):
	if n < 2:
		return False
	if n % 2 == 0:
		return False
	for d in range(3, n // 2, 2):
		if n % d == 0:
			return False
	return True
n = int(input())
for i in range(4, n, 2):
	other = n - i
	if not is_prime(other):
		print(i, other)
		break


n = int(input())
a = int(n / 2)
b = a
if n % 2 != 0:
	b += 1

def comp(a):
	c = 0
	for i in range(2, a):
		if a % i != 0:
			c += 1
	if c == a - 2:
		return 1
	else:
		return 0
while comp(a) != 0 or comp(b) != 0:
	a -= 1
	b += 1
print(a, b)


def isprime(a):
	if a <= 1:
		return False
	i = 2
	while i * i <= a:
		if a % i == 0:
			return False
		i += 1
	return True
n = int(input())
a = 4
while isprime(a) or isprime(n - a):
	a += 1
print(a, n - a)


def composite_sieve_eratosthenes(num):
	composite = [False for i in range(num + 1)]
	p = 2
	while p * p <= num:
		if composite[p] == False:
			for i in range(p * p, num + 1, p):
				composite[i] = True
		p += 1
	return composite
composite = composite_sieve_eratosthenes(1000000)
n = int(input())
for i in range(4, n):
	if composite[n - i] and composite[i]:
		print(i, n - i)
		break


from math import sqrt

def is_prime(x):
	i = 2
	limit = sqrt(x) + 1
	while i <= limit:
		if x % i == 0 and i != x and (i != 1):
			return False
		i += 1
	return True

def solve(n):
	for i in range(2, n - 1):
		if not is_prime(i) and (not is_prime(n - i)):
			return (i, n - i)

def main():
	n = int(input())
	print(*solve(n))
main()


SIZE = 1000001
isPrime = [True] * SIZE

def calcPrime():
	isPrime[0] = isPrime[1] = False
	for i in range(2, SIZE):
		if isPrime[i]:
			for j in range(i * 2, SIZE, i):
				isPrime[j] = False
calcPrime()
n = int(input())
for i in range(4, SIZE):
	if isPrime[i] == isPrime[n - i] == False:
		print(i, n - i)
		break


n = int(input())

def isPrime(num):
	for i in range(2, num):
		if num % i == 0:
			prime = False
			break
		else:
			prime = True
	return prime
for i in range(n // 2, 3, -1):
	if isPrime(i) == False and isPrime(n - i) == False:
		print(i, n - i)
		break


a = int(input())
check = False
for i in range(4, a + 1, 2):
	b = a - i
	for j in range(2, (b + 1) // 2):
		if b % j == 0:
			check = True
			break
	if check == True:
		break
print(b, ' ', a - b)


import math

def main():
	n = int(input())
	for i in range(1, n):
		if composite(i) and composite(n - i):
			print(i, n - i)
			break

def composite(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False
main()


i = int(input())
if i & 1 == 0:
	print(4, i - 4)
else:
	print(9, i - 9)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

class Prime:

	def __init__(self, n):
		self.M = m = int(math.sqrt(n)) + 10
		self.A = a = [True] * m
		a[0] = a[1] = False
		self.T = t = []
		for i in range(2, int(math.sqrt(m)) + 1):
			if not a[i]:
				continue
			t.append(i)
			for j in range(i * i, m, i):
				a[j] = False

	def is_prime(self, n):
		return self.A[n]

	def division(self, n):
		d = collections.defaultdict(int)
		for c in self.T:
			while n % c == 0:
				d[c] += 1
				n //= c
			if n < 2:
				break
		if n > 1:
			d[n] += 1
		return d.items()

	def sowa(self, n):
		r = 1
		for (k, v) in self.division(n):
			t = 1
			for i in range(1, v + 1):
				t += math.pow(k, i)
			r *= t
		return r

def main():
	n = I()
	pr = Prime(10 ** 12)
	for i in range(4, 1000, 2):
		if pr.is_prime(n - i):
			continue
		return '{} {}'.format(i, n - i)
	return -1
print(main())


n = int(input())

def com(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
for i in range(4, n - 3):
	if com(i) and com(n - i):
		print(i, n - i)
		exit()


def is_composite(number):
	for devider in range(number)[2:]:
		if number % devider == 0:
			return True
	return False
num = int(input())
x = 4
find = False
while not find and x <= num // 2 + 1:
	y = num - x
	if is_composite(x) and is_composite(y):
		print(x, y)
		find = True
	else:
		x = x + 1


n = int(input())
if n % 2 == 0:
	print(8, n - 8)
if n % 2 == 1:
	print(9, n - 9)


n = int(input())
for i in range(4, n // 2 + 1):
	a = i
	b = n - i
	(f1, f2) = (0, 0)
	for j in range(2, a):
		if a % j == 0:
			f1 = 1
	for j in range(2, b):
		if b % j == 0:
			f2 = 1
	if f1 == f2 == 1:
		break
print(a, b)


n = int(input())
a = n // 2
b = n - a
run = True
while run:
	compositea = False
	compositeb = False
	for i in range(2, a):
		if a % i == 0:
			compositea = True
	for i in range(2, b):
		if b % i == 0:
			compositeb = True
	if compositea == True and compositeb == True:
		run = False
	else:
		a -= 1
		b += 1
print(a, b)


def composite(n):
	for x in range(2, n):
		if not n % x:
			return True
	return False
n = int(input())
for i in range(4, n):
	if composite(i) == True and composite(n - i) == True:
		print(i, end=' ')
		print(n - i, end=' ')
		break


N = int(input())
if N % 2 == 0:
	print(6, N - 6)
else:
	print(9, N - 9)


x = int(input())
if x % 10 == 0 and x > 10:
	print(x // 2, x // 2)
elif x % 2 == 0:
	print(4, x - 4)
else:
	print(9, x - 9)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
n = ii()
a = n % 2 + 8
print(a, n - a)


from sys import stdin, stdout
n = int(stdin.readline())

def is_prime(n):
	if n == 1:
		return False
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
if n % 2 == 0 and (not is_prime(n // 2)):
	stdout.write(str(n // 2) + ' ' + str(n // 2))
else:
	a = n // 2 if n % 2 == 1 else n // 2 - 1
	b = n // 2 + 1
	while True:
		if is_prime(a) or is_prime(b):
			a -= 1
			b += 1
			continue
		else:
			break
	stdout.write(str(a) + ' ' + str(b))


n = int(input())
breakpoint = False
breakpoint2 = False
for i in range(4, n // 2 + 1):
	for j in range(2, i):
		if i % j == 0:
			for k in range(2, n - i):
				if (n - i) % k == 0:
					print(i, n - i)
					breakpoint = True
					breakpoint2 = True
					break
		if breakpoint2 == True:
			break
	if breakpoint == True:
		break


need = int(input())
if need % 2 == 0:
	print(need - 4, 4)
else:
	print(need - 9, 9)


n = input()
n = int(n)
if n % 2 == 0:
	s = 4
	g = n - 4
	print(s, g)
if n % 2 > 0:
	s = 9
	g = n - 9
	print(s, g)


n = int(input())
p = n % 2 + 8
print(p, n - p)


n = int(input())
if n % 2 == 0:
	if n / 2 % 2 == 0:
		print(int(n / 2), int(n / 2))
	else:
		print(int(n / 2 - 1), int(n / 2 + 1))
else:
	a = 4
	b = int(n - a)
	con2 = 0
	for i in range(2, b):
		if b % i == 0:
			con2 = 1
	if con2 != 0:
		print(int(a), int(b))
	else:
		con = 0
		for i in range(2, b - 2):
			if (b - 2) % i == 0:
				con = 1
		if con != 0:
			print(int(a + 2), int(b - 2))
		else:
			print(int(a + 4), int(b - 4))


num = int(input())
factor = 0
if num % 2 == 0:
	print(num - 4, 4)
else:
	print(num - 9, 9)


def isPrime(n):
	if n == 2 or n == 3:
		return True
	if n % 2 == 0 or n < 2:
		return False
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True

def composed(n):
	left_half = n / 2
	right_half = n / 2
	for i in range(n):
		if isPrime(left_half) == False and isPrime(right_half) == False:
			break
		else:
			left_half -= 0.5
			right_half += 0.5
	left_half = int(left_half)
	right_half = int(right_half)
	print(left_half, right_half)
n = int(input())
composed(n)


import sys
import math

def is_composite_number(x):
	if x < 4:
		return False
	if x % 2 == 0:
		return True
	for i in range(3, int(math.sqrt(x)) + 1, 2):
		if x % i == 0:
			return True
	return False

def solve(input_path=None):
	if input_path is None:
		f = sys.stdin
	else:
		f = open(input_path, 'r')
	n = int(f.readline())
	for i in range(n // 2, 0, -1):
		if is_composite_number(i) and is_composite_number(n - i):
			print(f'{i} {n - i}')
			break
solve()


def primo(num):
	if num < 2:
		return False
	if num == 2:
		return True
	for i in range(1, num):
		if num % i == 0 and i != 1 and (i != num):
			return False
	return True
num = int(input())
for i in range(1, num - 1):
	if not primo(i) and (not primo(num - i)) and (i > 1) and (num - i > 1):
		print(i, num - i)
		break


def pri_check(a):
	from math import sqrt
	if a > 3:
		num = a
		end = int(sqrt(num)) + 1
		check = True
		for x in range(2, end):
			if num % x == 0:
				check = False
				break
		if check and num != 1:
			return False
		else:
			return True
	else:
		return False

def main():
	a = int(input())
	for i in range(0, a):
		b = a - i
		if pri_check(b) and pri_check(i):
			out = str(b) + ' ' + str(i)
			print(out)
			break
main()


n = int(input())
if n % 2 == 0:
	if n % 4 == 0:
		print(str(n // 2) + ' ' + str(n // 2))
	else:
		print(str(n // 2 + 1) + ' ' + str(n // 2 - 1))
else:
	print('9 ' + str(n - 9))


def is_prime(m):
	if m == 2:
		return True
	else:
		k = int(m / 2)
		f = 0
		for i in range(2, k + 1):
			if m % i == 0:
				f = 1
				return True
		if f == 0:
			return False
n = int(input())
for j in range(3, n):
	if is_prime(j) and is_prime(n - j):
		print(j, n - j)
		break


def comp(n):
	for i in range(3, n // 2 + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
if n == 13:
	print(4, 9)
elif n % 2 == 0:
	for (i, j) in zip(range(n // 2, -1, -1), range(n // 2, n)):
		if comp(i) == True and comp(j) == True:
			print(i, j)
			break
else:
	for (i, j) in zip(range(n // 2, -1, -1), range(n // 2 + 1, n)):
		if comp(i) == True and comp(j) == True:
			print(i, j)
			break


import math

def is_complex(n):
	lim = math.ceil(math.sqrt(n))
	for i in range(2, lim + 1):
		if n % i == 0:
			return True
	return False

def main():
	n = int(input())
	for i in range(4, math.ceil(n / 2)):
		if is_complex(i) and is_complex(n - i):
			print(i, n - i)
			break
	else:
		print('Not great')
main()


import math
n = int(input())
isComp = [0] * n
(isComp[0], isComp[1]) = (1, 1)
for i in range(2, n):
	if isComp[i] == 0:
		for j in range(2 * i, n, i):
			isComp[j] = 1
for l in range(2, n):
	if isComp[l]:
		if isComp[n - l]:
			print(str(l) + ' ' + str(n - l))
			break


n = int(input())

def composite(n):
	for i in range(2, n):
		if n % i == 0:
			return True
			break
	else:
		return False
for j in range(4, n // 2 + 2):
	if composite(j) and composite(n - j):
		print(j, n - j)
		break


__author__ = 'JohnHook'
n = int(input())

def simple(n):
	if n <= 1:
		return False
	from math import sqrt
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
for i in range(2, n):
	if not simple(i) and (not simple(n - i)):
		print('{0} {1}'.format(i, n - i))
		exit()


n = int(input())
(a, b) = (3, n - 3)
ans = []
while a <= b:
	a += 1
	b -= 1
	for i in range(2, a):
		if a % i == 0:
			ans = a
			for j in range(2, b):
				if b % j == 0:
					ans = ans + b
					break
	if ans == n:
		print(a, b)
		break


def isprime(n):
	mark = 0
	for i in range(2, n):
		if n % i == 0:
			mark = 1
			break
	return mark
n = int(input())
for i in range(2, n):
	if isprime(i) == 1 and isprime(n - i) == 1:
		print(i, n - i)
		break


n = int(input())
prime = [True for i in range(10 ** 6 + 1)]
prime[0] = False
prime[1] = False
p = 2
while p * p <= 10 ** 6:
	if prime[p] == True:
		for i in range(p * p, 10 ** 6 + 1, p):
			prime[i] = False
	p += 1
num = 4
while True:
	if prime[num] == False and prime[n - num] == False:
		print(num, n - num)
		break
	num += 1


n = int(input())
if n % 2 == 0:
	print(n - 4, 4)
else:
	x = 9
	y = n - 9
	for i in range(1, y):
		if y % i == 0:
			print(x, y)
			break
		if i == y // 2:
			x = 8
			y = n - 8
			for j in range(1, y):
				if y % j == 0:
					print(x, y)
					break
			break


def two_composite_numbers(n):
	if n % 2 == 0:
		return (4, n - 4)
	elif n < 18:
		return (n - 9, 9)
	else:
		return (9, n - 9)

def main():
	n = int(input())
	result = two_composite_numbers(n)
	print(' '.join((str(i) for i in result)))
main()


import math

def complicated(numb):
	for dev in range(2, math.floor(math.sqrt(numb)) + 1):
		if not numb % dev:
			return True
	return False
n = int(input())
a = {i for i in range(2, n + 1)}
for i in range(n)[2:]:
	if complicated(i) and complicated(n - i):
		print(i, n - i)
		break


def isPrime(Number):
	return 2 in [Number, 2 ** Number % Number]
n = int(input())
i = 4
while True:
	if isPrime(n - i) or isPrime(i):
		i = i + 1
	else:
		break
print(str(int(n - i)) + ' ' + str(int(i)))


n = int(input())
for i in range(4, n // 2 + 1):
	d = 0
	for j in range(2, i // 2 + 1):
		if i % j == 0:
			d += 1
	if d > 0:
		if i != n / 2:
			dd = 0
			b = n - i
			for jj in range(2, b // 2 + 1):
				if b % jj == 0:
					dd += 1
					break
			if dd > 0:
				print(i, b)
				break


from sys import stdin, stdout

def main():
	n = stdin.readline()
	n = int(n)
	if n % 2 == 0:
		x = 4
		y = n - 4
	else:
		x = 9
		y = n - 9
	stdout.write(str(x) + ' ' + str(y))
main()


import math

def is_prime(num):
	d = 2
	for i in range(d, int(math.sqrt(num) + 1)):
		if num % i == 0:
			return False
	return True
n = int(input())
a = int(math.floor(n / 2))
b = int(math.ceil(n / 2))
while is_prime(a) or is_prime(b):
	a -= 1
	b += 1
print(a, b)


n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	print(min(9, n - 9), max(9, n - 9))


import math

def iscomp(p):
	for i in range(2, int(math.sqrt(p)) + 1):
		if p % i == 0:
			return True
	return False
n = int(input())
for i in range(4, 1004, 2):
	if iscomp(n - i) == True:
		print(i, n - i)
		break


def comp(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
n = int(input())
f = 0
for i in range(2, n):
	for j in range(2, n):
		if i + j == n and comp(i) == True and (comp(j) == True):
			print(i, j)
			f = 1
			break
	if f == 1:
		break


import math

def isPrime(x):
	if x % 2 == 0:
		return False
	for i in range(3, int(math.sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True

def Main():
	n = int(input())
	for x in range(4, (n + 1) // 2):
		if isPrime(x) == False and isPrime(n - x) == False:
			print(x, n - x)
			break
Main()


import math

def get_primes(n):
	m = n + 1
	numbers = [True for i in range(m)]
	for i in range(2, int(math.sqrt(n))):
		if numbers[i]:
			for j in range(i * i, m, i):
				numbers[j] = False
	primes = []
	for i in range(2, m):
		if numbers[i]:
			primes.append(i)
	return primes
a = int(input())
if a % 2 == 0:
	a = a // 2
	if a % 2 != 0:
		l = a + 1
		r = a - 1
		print(str(l) + ' ' + str(r))
	else:
		print(str(a) + ' ' + str(a))
else:
	prima = get_primes(1000000)
	l = a // 2
	r = l + 1
	while l in prima or r in prima:
		l -= 1
		r += 1
	print(str(l) + ' ' + str(r))


import math

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
up = 0
down = 0
if n / 2 == n // 2:
	up = n / 2 + 1
	down = n / 2 - 1
else:
	up = math.ceil(n / 2)
	down = math.floor(n / 2)
while isPrime(up) or isPrime(down):
	up = up + 1
	down = down - 1
up = int(up)
down = int(down)
print(str(up) + ' ' + str(down))


def f(n1, n2):
	l1 = [1 for i in range(1, n1 + 1) if n1 % i == 0]
	l2 = [1 for i in range(1, n2 + 1) if n2 % i == 0]
	if l1.count(1) != 2 and l2.count(1) != 2:
		return str(n1) + ' ' + str(n2)
	else:
		n1 -= 1
		n2 += 1
		return f(n1, n2)
n = int(input())
if n % 2 == 0:
	print(f(int(n / 2), int(n / 2)))
else:
	print(f(int((n - 1) / 2), int((n + 1) / 2)))


n = int(input())
(x, y) = (0, 0)
k = 0
if n % 2 == 0:
	(x, y) = (4, n - 4)
else:
	for i in range(3, n, 2):
		for j in {3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}:
			if i % j == 0 and i != j:
				k += 1
				break
		if k != 0:
			(x, y) = (i, n - i)
			break
if x > y:
	(x, y) = (y, x)
print(x, y)


def prime(n):
	for i in range(2, int(n ** (1 / 2) + 1)):
		if n % i == 0:
			return False
	return True
n = int(input())
k = n // 2
while prime(k) or prime(n - k):
	k -= 1
print('{} {}'.format(k, n - k))


def isComposite(n):
	d = 2
	while d * d <= n:
		if n % d == 0:
			return True
		d += 1
	return False

def main():
	num = int(input())
	a = int(num / 2)
	b = num - a
	while not isComposite(a) or not isComposite(b):
		a -= 1
		b += 1
	print(str(a) + ' ' + str(b))
main()


n = int(input())
if n % 2 == 0:
	print(min(8, n - 8), max(8, n - 8))
else:
	print(min(9, n - 9), max(9, n - 9))


def isPrime(num):
	for i in range(2, num):
		if num % i == 0:
			return False
			break
	else:
		return True
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	(a, b) = (4, n - 4)
	while isPrime(b):
		a += 2
		b -= 2
	print(a, b)


a = int(input())
b = 4
c = a - b
while a >= 12:
	if c % 2 == 0 or c % 3 == 0:
		print(str(b) + ' ' + str(c))
		break
	else:
		b = b + 2
		c = a - b


import sys
x = int(input())
y = x / 2
wyniczek = x - 4
inny = x - 4
inny_i = x - 9
if x % 2 == 0:
	print(wyniczek, x - wyniczek)
	sys.exit()
elif x % 10 == 5:
	print(x - 9, 9)
	sys.exit()
elif inny % 3 == 0:
	print(inny, x - inny)
	sys.exit()
elif inny_i % 2 == 0 or inny_i % 3 == 0:
	print(inny_i, 9)


def math(n):
	if n % 2 == 0:
		x = 4
	else:
		x = 9
	return x
n = input()
ans = math(int(n))
print(ans, '', int(n) - ans)


a = int(input())
for i in range(4, 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 2):
	b = a - i
	if b % 3 == 0 or b % 5 == 0 or b % 2 == 0:
		print(b, a - b)
		break


from math import sqrt

def isPrime(num):
	for i in range(2, int(sqrt(num)) + 1):
		if num % i == 0:
			return False
	return True
n = int(input())
a = int(n / 2)
b = n - a
while isPrime(a) or isPrime(b):
	a += 1
	b = n - a
print(b, a)


def primenumber(i):
	n = 2
	while n <= i ** 0.5:
		if i % n == 0:
			return 1
		n += 1
	else:
		return 0
n = int(input())
i = 4
while i <= n * 0.5:
	if primenumber(i) == 1 and primenumber(n - i) == 1:
		print(i, n - i)
		break
	i += 1


a = int(input())
if a % 4 == 0:
	s = str(int(a / 2))
	d = s + ' ' + s
elif a % 4 == 1 or a % 4 == 3:
	l = min(9, a - 9)
	r = max(9, a - 9)
	d = str(l) + ' ' + str(r)
else:
	d = str(6) + ' ' + str(a - 6)
print(d)


def compNum(n):
	primFactors = []
	i = 2
	while i * i <= n:
		if n % i == 0:
			primFactors.append(i)
			n = n // i
		else:
			i = i + 1
	if n > 1:
		primFactors.append(n)
	if len(primFactors) >= 2:
		return n
import math
n = int(input())
x = math.ceil(n / 2)
y = n - x
if compNum(x) and compNum(y):
	print(x, y)
else:
	for i in range(500001):
		x = x + 1
		y = n - x
		if compNum(x) and compNum(y):
			print(x, y)
			break


n = int(input())
for i in (4, 6, 8):
	if not (n - i) % 3:
		print(i, n - i)
		break


def isprime(a):
	k = 1
	for i in range(2, a // 2):
		if a % i == 0:
			k = 0
			break
	return k
n = int(input())
p = 4
q = n - 4
while isprime(q) == 1:
	p += 2
	q -= 2
print(p, q)


import math
n = int(input())
if n % 2 == 0:
	a = 4
	b = n - a
	print(str(a) + ' ' + str(b))
else:
	initial = n - 4
	jud = False
	a = 0
	for odd in range(9, initial + 1, 2):
		for j in range(2, int(math.sqrt(odd)) + 1):
			if odd % j == 0:
				jud = True
				break
		if jud == True:
			a = odd
			break
	print(str(a) + ' ' + str(n - a))


def sost(n):
	for i in range(2, int(n / 2) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n):
	if sost(i) and sost(n - i):
		print(i, n - i)
		quit()


def check(X, Y):
	if X % 2 == 0 and Y % 3 == 0:
		return [X, Y]
	else:
		X -= 1
		Y += 1
		return check(X, Y)
from math import floor, ceil
N = int(input())
if N % 2 == 0:
	if N // 2 % 2 == 0:
		print('{} {}'.format(N // 2, N // 2))
	else:
		X = Y = N // 2
		R = check(X, Y)
		print('{} {}'.format(R[0], R[1]))
else:
	(X, Y) = (ceil(N / 2), floor(N / 2))
	R = check(X, Y)
	print('{} {}'.format(R[0], R[1]))


def find(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
k = n // 2
for i in range(4, k + 1):
	if find(i):
		if find(n - i):
			print(i, n - i)
			break


import sys, math
n = int(input())

def is_prime(x):
	if x <= 1:
		return False
	t = int(math.sqrt(x))
	for i in range(2, t + 1):
		if x % i == 0:
			return False
	return True
for x in range(3, n):
	y = n - x
	if not (is_prime(x) or is_prime(y)):
		print(x, y)
		break


def is_prime(x):
	if x >= 2:
		for y in range(2, x):
			if not x % y:
				return False
	else:
		return False
	return True
n = int(input())
for i in range(4, n - 3):
	if is_prime(i):
		continue
	else:
		z = n - i
		if is_prime(z):
			continue
		else:
			print(i, z)
			break


import math

def isComposite(n):
	if n == 2:
		return False
	i = 2
	limit = int(math.sqrt(n))
	while i <= limit:
		if n % i == 0:
			return True
		i += 1
	return False
n = int(input())
(x, y) = (min(n - n // 2, n // 2), max(n - n // 2, n // 2))
while not isComposite(x) or not isComposite(y):
	x -= 1
	y += 1
	isComposite(x)
	isComposite(y)
print(x, y)


def prime_test(num):
	import math
	limit = int(math.sqrt(num))
	count = 0
	for i in range(2, limit + 1):
		if num % i == 0:
			count += 1
	if count == 0:
		return True
	else:
		return False
number = input()
number = int(number)
if number % 2 == 1:
	limit = int(number / 2)
	for i in range(4, limit + 1, 2):
		if not prime_test(number - i):
			print('%d %d' % (i, number - i))
			break
elif number / 2 % 2 == 0:
	print('%d %d' % (int(number / 2), int(number / 2)))
else:
	print('%d %d' % (number / 2 - 1, number / 2 + 1))


n = int(input())
if n % 2 == 1:
	print(9, n - 9)
elif n // 2 % 2 == 1:
	print(n // 2 + 1, n // 2 - 1)
else:
	print(n // 2, n // 2)


n = int(input())
if n % 2 == 0 or n % 3 == 1:
	print('4', end=' ')
	print(n - 4)
elif n % 3 == 2:
	print('8', end=' ')
	print(n - 8)
elif n % 3 == 0:
	print('6', end=' ')
	print(n - 6)


def is_complex(n):
	if n == 2:
		return False
	if n == 3:
		return False
	for i in range(2, int(n ** 0.5) + 2):
		if n % i == 0:
			return True
	return False
n = int(input())
for k in range(n // 2, 3, -1):
	if is_complex(k) and is_complex(n - k):
		print(str(k) + ' ' + str(n - k))
		break


from sys import *
from math import *
import sys

def prime(x):
	j = 2
	while j * j <= x:
		if x % j == 0:
			return 0
		j += 1
	return 1

def main():
	s = 1000000
	n = int(input())
	for i in range(2, n // 2 + 1):
		if not prime(n - i) and (not prime(i)):
			print(i, n - i)
			return 0
main()


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def solve():
	primes = [1] * (10 ** 6 + 1)
	i = 2
	while i ** i < 10 ** 6 + 1:
		if primes[i] == 1:
			j = 2
			while i * j <= 10 ** 6 + 1:
				primes[i * j] = 0
				j += 1
		i += 1
	n = int(input())
	k = 4
	while primes[k] or primes[n - k]:
		k += 1
	print(k, n - k)
solve()


def isPrime(n):
	for _ in range(2, n - 1):
		if n % _ == 0:
			return False
	return True
n = int(input())
for _ in range(4, n - 1):
	if not isPrime(_) and (not isPrime(n - _)):
		print(_, n - _)
		break


inpt = int(input())
if inpt % 2 == 0:
	print(8, inpt - 8)
else:
	print(9, inpt - 9)


n = int(input())
if n % 2 == 0:
	print(4, n - 4)
elif n > 12:
	print(9, n - 9)


n = int(input())
y = 4 if n % 2 == 0 else 9
print(str(n - y) + ' ' + str(y))


s = int(input())
temp = s % 2 + 8
print(temp, s - temp)


import math
import os
import random
import re
import sys
from itertools import permutations
limit = 1000000

def calculate_prime():
	prime_flag = [True] * limit
	prime_flag[0] = prime_flag[1] = False
	for i in range(2, limit):
		if prime_flag[i] == True:
			for j in range(i * i, limit, i):
				prime_flag[j] = False
	return prime_flag
primeflag = calculate_prime()
n = int(input())
for j in range(2, n):
	k = primeflag[j]
	if k == False:
		p = n - j
		k = primeflag[p]
		if k == False:
			print(j, p)
			break


def isnp(num):
	count = 0
	for i in range(1, num + 1):
		if num % i == 0:
			count += 1
	if count > 2:
		return True
	else:
		return False
n = int(input())
for i in range(1, n + 1):
	if isnp(i) and isnp(n - i):
		print(i, n - i)
		break


n = int(input())

def fun(x):
	for n in range(3, x // 2, 2):
		if x % n == 0:
			return False
	return True
if n % 2 == 0:
	if n % 4 == 0:
		print(int(n / 2), int(n / 2))
		exit()
	else:
		print(int(n / 2 + 1), int(n / 2 - 1))
		exit()
else:
	x = n // 2
	y = n // 2 + 1
	if x % 2 != 0:
		while True:
			if fun(x) == False:
				print(x, y)
				exit()
			else:
				x = int(x + 2)
				y = int(y - 2)
	else:
		while True:
			if fun(y) == False:
				print(x, y)
				exit()
			else:
				x = x - 2
				y = y + 2


def prime(n):
	for i in range(2, n):
		if n % i == 0:
			return 1
	return 0
n = int(input())
n1 = 4
n2 = n - 4
for i in range(1, n + 1):
	p = prime(n1)
	p1 = prime(n2)
	if p == 1 and p1 == 1:
		print(n1, n2)
		break
	n1 += 1
	n2 -= 1


def is_prime(a):
	return all((a % i for i in range(2, int(a ** (1 / 2) + 1))))
n = int(input())
l = n // 2
if n % 2 == 0:
	a = l
else:
	a = l + 1
while is_prime(a) or is_prime(l):
	a += 1
	l -= 1
print(l, ' ', a)


def isPrime(Number):
	return 2 in [Number, 2 ** Number % Number]

def _472A(number):
	if number % 2 == 0:
		return [4, number - 4]
	for index in range(4, number // 2 + 1):
		if not isPrime(number - index) and (not isPrime(index)):
			return [index, number - index]
print(' '.join(list(map(lambda x: str(x), _472A(int(input()))))))


n = int(input())

def isProst(x):
	for i in range(2, x - 1):
		if not x % i:
			return True
	return False
for i in range(4, n):
	if isProst(i) and isProst(n - i):
		print(i, n - i)
		break


n = int(input())
x = n - (n - 4)
y = n - 4
while x % 2 != 0 or y % 3 != 0:
	x += 1
	y -= 1
print(x, y)


from sys import stdin
input = stdin.readline

def math(n):
	sieve = [1] * (n + 1)
	sieve[:2] = [0] * 2
	for i in range(2, int(n ** 0.5) + 1):
		if sieve[i]:
			sieve[i * i:n + 1:i] = [0] * (n // i - i + 1)
	for j in range(4, n - 1):
		if not (sieve[j] or sieve[n - j]):
			return '%d %d' % (j, n - j)
print(math(int(input())))


def CanDiv(N):
	D = 0
	for i in range(1, N + 1):
		if N % i == 0:
			D += 1
	return D
N = int(input())
for j in range(0, N):
	if CanDiv(j) > 2 and CanDiv(N - j) > 2:
		print(j, N - j)
		break


import collections
import itertools
import sys
from bisect import bisect_left
from collections import defaultdict, Counter
from math import sqrt, ceil
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def pr(a):
	r = sqrt(a)
	for i in range(2, int(r) + 1):
		if a % i == 0:
			return i
	return None

def res(param):
	for j in range(2, int(sqrt(param)) + 1):
		if param % j == 0:
			return j
	return None

def main():
	n = inp()
	for i in range(2, n // 2 + 1):
		a = res(i)
		b = res(n - i)
		if a and b:
			print(i, n - i)
			return
main()


def isprime(n):
	return all([n % i for i in range(2, int(n ** (1 / 2) + 1.5))])
x = 4
a = int(input())
while isprime(x) or isprime(a - x):
	x += 1
print(x, a - x)


import sys
import queue
data = sys.stdin.read().split()
N = int(data[0])

def composite(n):
	if n == 1:
		return False
	for i in range(2, n - 1):
		if n % i == 0:
			return True
		if i * i > n:
			break
	return False
for i in range(2, int(N / 2) + 1):
	j = N - i
	if composite(i) and composite(j):
		print(i, ' ', j)
		break


n = int(input().strip())

def isComposite(n):
	fl = False
	for i in range(2, n):
		if n % i == 0:
			return True
			break
	return fl
for i in range(1, n):
	a = i
	b = n - 1
	if isComposite(a) and isComposite(b):
		print(a, b)
		break
	n -= 1


x = int(input())
y = 9 if x % 2 else 4
print(f'{x - y} {y}')


import sys
import math

def isprime(b):
	if b == 1:
		return 0
	if b == 2 or b == 3:
		return 1
	if b % 2 == 0 or b % 3 == 0:
		return 0
	i = 5
	for i in range(5, int(math.sqrt(b)) + 1):
		if b % i == 0 or b % (i + 2) == 0:
			return 0
	return 1
a = int(input())
for c in range(4, a // 2 + 1):
	if isprime(c) == 0 and isprime(a - c) == 0:
		print(c, a - c)
		break


n = int(input())
dic = []
for i in range(1, n):
	(lis1, lis2) = ([], [])
	for j in range(1, i - 1):
		if i % j == 0:
			lis1.append(j)
	for k in range(1, n - i - 1):
		if (n - i) % k == 0:
			lis2.append(k)
		if len(lis2) > 1:
			break
	if len(lis1) > 1 and len(lis2) > 1:
		dic.append(i)
		break
print(dic[0], n - dic[0])


number = int(input())

def is_prime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
find_res = False
for i in range(int(number / 2 + 1)):
	if is_prime(i):
		continue
	for j in range(number):
		if i + j == number:
			if not is_prime(i) and (not is_prime(j)):
				print(i, j)
				find_res = True
				break
	if find_res:
		break


number = int(input())

def checkprime(input1):
	factor = 2
	while input1 % factor != 0:
		factor += 1
	if factor == input1:
		results = 'yes'
	else:
		results = 'no'
	return results
for x in range(2, number):
	a = x
	if checkprime(a) == 'no' and checkprime(number - a) == 'no':
		break
print(a, number - a)


n = int(input())

def getResult(n):
	if n % 2 == 1:
		return (9, n - 9)
	else:
		return (4, n - 4)
for i in getResult(n):
	print(i, end=' ')


def is_prime(number):
	count = 0
	for i in range(2, number):
		if number % i == 0:
			count += 1
	if count == 0:
		return True
	return False

def check(number):
	num_start = 2
	while num_start != number - 1:
		if not is_prime(num_start) and (not is_prime(number - num_start)):
			print(num_start, number - num_start)
			break
		else:
			num_start += 1
check(int(input()))


def find_divisors(num):
	divisors = []
	i = 1
	while i ** 2 <= num:
		if num % i == 0:
			divisors.append(i)
			if i != num // i:
				divisors.append(num // i)
		i += 1
	return divisors
n = int(input())
for i in range(4, n // 2 + 1):
	if len(find_divisors(i)) > 2 and len(find_divisors(n - i)) > 2:
		print(i, n - i)
		break


import sys

def get():
	return int(sys.stdin.readline().strip())

def isPrime(n):
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = get()
(a, b) = (4, n - 4)
while True:
	if isPrime(a) and isPrime(b):
		break
	a += 1
	b -= 1
print(a, b)


import math
n = int(input())

def check(x):
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return True
	return False
i = 4
while i <= n // 2:
	if check(n - i):
		print(i, n - i, sep=' ')
		break
	else:
		i += 2


def prost(a):
	if a < 2:
		return 0
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return 0
	return 1
n = int(input())
p = n // 2
d = n - p
oz = 1
while oz == 1:
	if prost(p) == 1 or prost(d) == 1:
		p = p - 1
		d = d + 1
	else:
		oz = 0
print(p, d)


def design(num):
	if num % 2 == 1:
		print(9, num - 9)
	else:
		print(8, num - 8)
n = int(input())
design(n)


n = int(input())
if n >= 12:
	if n % 2 == 0:
		n = n - 4
		if n % 2 == 0:
			print(n, ' 4')
	elif n % 3 == 0:
		n = n - 6
		if n % 3 == 0:
			print(n, ' 6')
	else:
		z = n - 4
		if z % 3 == 0:
			print(z, '4')
		y = n - 8
		if y % 3 == 0:
			print(y, '8')


n = int(input())
import math
i = 2
while i < math.ceil(n / 2):
	p = 1
	s = -1
	while p < math.ceil(i / 2):
		if i / p == int(i / p):
			s = s + 1
		p = p + 1
	if s >= 1:
		p = 1
		m = -1
		while p < math.ceil((n - i) / 2):
			if (n - i) / p == int((n - i) / p):
				m = m + 1
			p = p + 1
		if m >= 1:
			print(i, n - i)
			break
	i = i + 1
if n == 12:
	print(4, 8)
if n == 13:
	print(4, 9)


import math
n = int(input())

def is_prime(a):
	if a == 1:
		return False
	if a == 2:
		return True
	if a % 2 == 0:
		return False
	else:
		i = 3
		while i <= math.sqrt(a):
			if a % i == 0:
				return False
			i += 2
		return True
if n % 2 == 0:
	print('%d %d' % (4, n - 4))
else:
	x = 2
	y = n - x
	while is_prime(x) or is_prime(y):
		x += 1
		y = n - x
	print('%d %d' % (x, y))


def is_prime(x):
	for _ in range(2, x):
		if x % _ == 0:
			return False
			break
	return True
n = int(input())
i = 1
j = n - 1
while True:
	if is_prime(i) is False and is_prime(j) is False:
		if i + j == n:
			print(i, j, sep=' ')
			exit()
	i += 1
	j -= 1


a = int(input())
import math

def is_prime(num):
	is_prime = True
	for i in range(2, int(math.sqrt(num)) + 1):
		if num % i == 0 and (not i == 1):
			is_prime = False
			break
	return is_prime
for i in range(4, a + 1):
	if not is_prime(i) and (not is_prime(a - i)):
		print(i, a - i)
		break


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
x = int(input())
a = 4
b = x - 4
while b >= 4:
	if isPrime(a) == False and isPrime(b) == False:
		break
	else:
		a = a + 1
		b = b - 1
print(a, end=' ')
print(b)


import sys

def sst(c):
	d = 2
	while d ** 2 <= c:
		if c % d == 0 and (not c == d):
			return True
		d += 1
	return False
kf = int(input())
r = 1
for d in range(kf // 2):
	if sst(r) and sst(kf - r):
		print(r, kf - r)
		sys.exit(0)
	r += 1


a = int(input())
prime = [False] * 2 + [True] * (a - 1)

def SieveFunc(N):
	for i in range(2, int(N ** 0.5) + 1):
		if prime[i]:
			for j in range(i * i, N + 1, i):
				prime[j] = False
SieveFunc(a)
f = 0
if a % 2 == 0:
	left = a - 8
	while prime[left]:
		left -= 1
		f += 1
	else:
		print(8 + f, left)
else:
	left = a - 9
	while prime[left]:
		left -= 1
		f += 1
	else:
		print(9 + f, left)


n = int(input())
if n % 3 == 0 and n != 12 and (n != 15):
	print('12' + ' ' + str(n - 12))
if n == 12:
	print('4 8')
if n == 15:
	print('6 9')
if n % 3 == 1:
	print('4 ' + str(n - 4))
if n % 3 == 2:
	print('8 ' + str(n - 8))


import math

def isprime(n):
	if n == 1:
		return False
	else:
		for i in range(2, math.floor(math.sqrt(n)) + 1):
			if n % i == 0:
				return False
	return True
n = int(input())
if n % 2 == 0:
	a = n // 2
	b = n // 2
elif n % 2 == 1:
	a = (n + 1) // 2
	b = (n - 1) // 2
run = True
while run:
	if isprime(a) or isprime(b):
		a -= 1
		b += 1
	elif isprime(a) == False and isprime(b) == False:
		print(a, b)
		run = False


def notsingle(num):
	for i in range(2, num):
		if num % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n):
	if notsingle(i):
		a = 1
		if notsingle(n - i):
			a = 2
	if a == 2:
		print(i, n - i)
		break


import math
n = int(input())

def f(m):
	for i in range(2, m):
		if m % i == 0:
			return True
			break
	if i == m - 1:
		return False
for i in range(4, n):
	if f(i) and f(n - i):
		print(i, n - i)
		break


import sys
N = int(sys.stdin.readline())
if not N % 2:
	print('4', N - 4)
else:
	print('9', N - 9)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
n = int(data())
if n & 1:
	out(*[9, n - 9])
else:
	out(*[4, n - 4])


x = int(input())
if x % 2 == 0 and x // 2 % 2 == 0:
	print(x // 2, x // 2)
	exit()
if x % 2 == 0 and x // 2 % 2 != 0:
	print(x // 2 - 1, x // 2 + 1)
else:
	print(9, x - 9)


def checked_prime_number(number):
	for i in range(1, number + 1):
		if i != 1 and i != number:
			if number % i == 0:
				return False
	return True
n = int(input())
x = 0
y = 0
if n % 2 == 0:
	x = int(n / 2)
	y = int(n / 2)
else:
	x = int(n / 2)
	y = int(n / 2) + 1
while True:
	if checked_prime_number(x) == False and checked_prime_number(y) == False:
		print('%d %d' % (x, y))
		break
	else:
		x += 1
		y -= 1


n = int(input())
if n % 2 == 0 and n // 2 % 2 == 0:
	print(n // 2, n // 2)
elif n % 2 == 0 and n // 2 % 2 != 0:
	print(n // 2 - 1, n // 2 + 1)
else:
	print(9, n - 9)


n = int(input())
f1 = 0
f2 = 0

def isprime(x):
	if x <= 1:
		return False
	else:
		for i in range(2, x // 2 + 1):
			if x % i == 0:
				return False
		return True
for i in range(2, n):
	if isprime(i) or isprime(n - i):
		continue
	else:
		f1 = i
		f2 = n - i
		break
print(f1, f2)


import math

def is_prime5(n):
	if n < 2:
		return False
	if n == 2:
		return True
	if n % 2 == 0:
		return False
	prime = True
	m = math.sqrt(n)
	m = int(m) + 1
	for x in range(3, m, 2):
		if n % x == 0:
			return False
	return True
p = int(input())
goon = True
for i in range(4, p // 2 + 1):
	r = is_prime5(i)
	n = is_prime5(p - i)
	if r == False and n == False:
		print(i, p - i)
		break


def is_composite(n):
	if n == 1 or n == 2 or n == 3:
		return False
	elif n % 6 == 5 or n % 6 == 1:
		i = 2
		while i < int((n + 1) / 2):
			if n % i == 0:
				return True
			i += 1
		return False
	else:
		return True
n = int(input())
num = int(n / 2)
w = None
number = 5
while w == None:
	if is_composite(number):
		if is_composite(n - number):
			w = True
		else:
			number += 1
	else:
		number += 1
print(str(number) + ' ' + str(n - number))


def composite(num):
	count = 0
	for i in range(1, num + 1):
		if num % i == 0:
			count = count + 1
		if count >= 3:
			return True
			break
	return False
num = int(input())
for i in range(4, num):
	if composite(i) == True and composite(num - i) == True:
		print(i, num - i)
		break
	else:
		continue


n = int(input())

def is_prime(x):
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			return False
	return True
for u in range(1, n // 2 + 1):
	if not is_prime(u):
		if not is_prime(n - u):
			print(u, n - u)
			break


n = eval(input())
print('9 ' + str(n - 9) if n % 2 else '4 ' + str(n - 4))


def composite(x):
	if x % 2 == 0:
		print(4, x - 4)
	else:
		print(9, x - 9)
n = int(input())
composite(n)


def IsPrime(x):
	if x == 2:
		return True
	if x % 2 == 0:
		return False
	div = 3
	while div * div <= x:
		if x % div == 0:
			return False
		div += 2
	return True
n = int(input())
if n % 4 == 0:
	print(n // 2, n // 2)
elif n % 2 == 0:
	print(6, n - 6)
else:
	a = n // 2
	while IsPrime(a) or IsPrime(n - a):
		a -= 1
	print(n - a, a)


n = int(input())
if n % 2 == 0:
	print(' '.join([str(4), str(n - 4)]))
if n % 2 == 1:
	print(' '.join([str(9), str(n - 9)]))


a = int(input())
d = int(4)
x = int(a - 4)
for i in range(2, int(x / 2)):
	if x % i == 0:
		print(d, x)
		break
else:
	print(9, a - 9)


def iscomp(x):
	i = 2
	while i * i <= x:
		if x % i == 0:
			return True
		i += 1
	return False
n = int(input())
for i in range(4, n):
	if iscomp(i) and iscomp(n - i):
		print(str(i) + ' ' + str(n - i))
		quit()


maxp = 1000
np = []
for i in range(2, maxp):
	j = 2
	while j * j <= i:
		if i % j == 0:
			np.append(i)
			break
		j += 1

def isprime(i):
	j = 2
	while j * j <= i:
		if i % j == 0:
			return False
		j += 1
	return True
n = int(input())
for i in np:
	if not isprime(n - i):
		print(i, n - i)
		break


def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
n = int(input())
prime = SieveOfEratosthenes(n)
for i in range(4, n):
	if prime[i] or prime[n - i]:
		continue
	else:
		print(i, n - i)
		break


def main():
	n = int(input())
	print(8 + n % 2, n - (8 + n % 2))
main()


def prime(n):
	if n == 1:
		return 1
	if n == 2 or n == 3:
		return 1
	elif n % 2 == 0:
		return 0
	else:
		for i in range(3, int(n ** 0.5) + 1, 2):
			if n % i == 0:
				return 0
		else:
			return 1
n = int(input())
l = n // 2
r = n - l
while prime(l) or prime(r):
	l -= 1
	r += 1
print(l, r)


from math import sqrt
from math import ceil

def sostav(x):
	for i in range(2, ceil(sqrt(x)) + 1):
		if x % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n):
	if sostav(i) and sostav(n - i):
		print(i, n - i)
		break


n = int(input())
if n % 2:
	print(9, n - 9, sep=' ')
else:
	print(4, n - 4, sep=' ')


def d(x):
	ans = 0
	for i in range(1, x + 1):
		if x % i == 0:
			ans += 1
	if ans > 2:
		return False
	else:
		return True
(n, b) = (int(input()), 0)
a = 5
b = n - a
while d(a) or d(b):
	a += 1
	b -= 1
print(f'{a} {b}')


n = int(input())
for i in range(2, 13):
	if i not in [2, 3, 5, 7, 11] and n - i not in [2, 3, 5, 7, 11]:
		if (n - i) % 2 == 0 or (n - i) % 3 == 0 or (n - i) % 5 == 0 or ((n - i) % 7 == 0) or ((n - i) % 11 == 0):
			print(i, n - i)
			break


n = int(input())
P = [1] * (n + 1)
for i in range(2, n + 1):
	if P[i]:
		for j in range(i * i, n + 1, i):
			P[j] = 0
for i in range(4, n):
	if not P[i] and (not P[n - i]):
		print(i, n - i)
		break


n = int(input())

def iscomp(x1):
	c = 0
	for i in range(2, x1):
		if x1 % i == 0:
			c = c + 1
			break
		else:
			pass
	if c > 0:
		return True
	else:
		return False
for i in range(4, n):
	if iscomp(i) and iscomp(n - i):
		print(i, n - i)
		break


def isnotprime(num):
	c = 0
	for i in range(2, num):
		if num % i == 0:
			c = 1
	return c
n = int(input())
j = 4
while 1:
	t = n - j
	if isnotprime(j) and isnotprime(t):
		break
	else:
		j += 1
print(str(j) + ' ' + str(t))


from math import sqrt

def isPrime(n):
	upper_bound = int(sqrt(n))
	for i in range(2, upper_bound + 1):
		if n % i == 0:
			return False
	return True
N = int(input())
a = N // 2
b = N - a
for offset in range(a):
	current_a = a - offset
	current_b = b + offset
	if isPrime(current_a) or isPrime(current_b):
		continue
	else:
		print(str(current_a) + ' ' + str(current_b))
		break


n = int(input())
print(8 + (n & 1), n - (8 + (n & 1)))


def isprime(int):
	count = 0
	for i in range(2, int):
		if int % i == 0:
			count += 1
	if count == 0:
		return True
	else:
		return False
n = int(input())
a = n - 1
b = 1
while isprime(a) == True or isprime(b) == True:
	b += 1
	a -= 1
print(a, end=' ')
print(b)


from math import sqrt

def isPrime(n):
	if n < 10:
		if n == 1:
			return False
		elif n == 2:
			return True
		elif n % 2 == 0:
			return False
		elif n % 3 == 0:
			return False
		return True
	else:
		if n % 2 == 0:
			return False
		for i in range(3, round(sqrt(n)), 2):
			if n % i == 0:
				return False
	return True

def Composite():
	n = int(input())
	if n % 2 == 0:
		if n // 2 % 2 == 0:
			print(f'{round(n / 2)} {round(n / 2)}')
		else:
			print(f'{round(n / 2 - 1)} {round(n / 2 + 1)}')
	else:
		even = n // 2
		odd = n // 2 + 1
		while isPrime(even) or isPrime(odd):
			even -= 1
			odd += 1
		print(f'{even} {odd}')
Composite()


from math import sqrt

def iscomposite(n):
	for i in range(2, int(sqrt(n) + 1)):
		if n % i == 0:
			return True
	return False
n = int(input())
if n % 2 == 0:
	x = n // 2
	y = n // 2
	while iscomposite(x) == False or iscomposite(y) == False:
		x -= 1
		y += 1
	print(x, y)
	exit()
else:
	x = (n + 1) // 2
	y = (n - 1) // 2
	while iscomposite(x) == False or iscomposite(y) == False:
		x += 1
		y -= 1
	print(x, y)
	exit()


import math

def isComposite(number):
	ok = 1
	for i in range(2, int(number / 2) + 1):
		if number % i == 0:
			ok = 0
	if ok == 1:
		return 0
	else:
		return 1
given_number = int(input())
for i in range(4, given_number):
	if isComposite(i) == 1 and isComposite(given_number - i) == 1:
		print(str(i) + ' ' + str(given_number - i))
		break


n = int(input())
a = [0] * (n + 1)
for i in range(2, n + 1):
	if a[i] == 0:
		k = i * 2
		while k <= n:
			a[k] = 1
			k += i
b = True
for i in range(n // 2, 2, -1):
	if not b:
		break
	for j in range(n // 2, n + 1):
		if a[i] == 1 and a[j] == 1 and (i + j == n):
			print('%u %u' % (i, j))
			b = False
			break


n = int(input())
x = 4
y = n - 4
if y % 2 == 0 and x % 2 == 0:
	print(x, y)
else:
	while x % 2 != 0 or y % 3 != 0:
		x += 1
		y -= 1
	print(x, y)


n = int(input())
if n % 4 == 0:
	print(f'{n // 2} {n // 2}')
elif n % 2 == 0:
	print(f'{n // 2 + 1} {n // 2 - 1}')
else:
	print(f'9 {n - 9}')


import sys
n = int(input())
sieve = list(range(n + 1))
sieve[1] = 0
for i in sieve:
	if i > 1:
		for j in range(i + i, len(sieve), i):
			sieve[j] = 0

def is_sost(x):
	return not sieve[x]
for i in range(4, n - 2):
	if is_sost(i) and is_sost(n - i):
		print(i, n - i)
		sys.exit()


number = int(input())
if number % 4 == 0:
	print(number // 2, number // 2)
elif number % 2 == 0:
	print(number // 2 + 1, number // 2 - 1)
else:
	num1 = 4
	num2 = number - 4
	while num2 % 3 != 0 and num2 % 5 != 0 and (num2 % 7 != 0):
		num1 += 2
		num2 -= 2
	print(num1, num2)


n = int(input())
q = (6, 4, 8)[n % 3]
print(q, n - q)


def sieve(n):
	p = [True] * (n + 1)
	p[0] = p[1] = False
	i = 4
	while i <= n:
		p[i] = False
		i += 2
	i = 3
	while i ** 2 <= n:
		j = i * 2
		while j <= n:
			p[j] = False
			j += i
		i += 2
	return p
n = int(input())
primes = sieve(n)
a = 4
while primes[a] or primes[n - a]:
	a += 1
print(a, n - a)


def isPrime(num):
	boo = True
	for i in range(2, int(num ** 0.5 + 1)):
		if num % i == 0:
			boo = False
			break
	return boo
n = int(input())
for i in range(4, n):
	if isPrime(n - i) == isPrime(i):
		print(i, n - i)
		break
	else:
		continue


n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	for k in list(range(4, n, 2)):
		i = 3
		if (n - k) % i == 0 or i >= int((n - k) ** (1 / 2)) + 1:
			break
		else:
			i += 2
	print(k, n - k)


n = int(input())
if n % 2 == 0:
	x1 = n - 4
	x2 = 4
else:
	x1 = n - 9
	x2 = 9
print(x1, x2)


from math import sqrt

def prime(p):
	for i in range(2, int(sqrt(p)) + 1):
		if p % i == 0:
			return False
	return True
n = int(input())
if n == 12:
	print(4, 8, sep=' ')
elif prime(n - 9):
	print(10, n - 10, sep=' ')
else:
	print(9, n - 9, sep=' ')


def is_comp(N):
	for x in range(2, N):
		if N % x == 0:
			return True
	return False
n = int(input())
a = int(n / 2)
b = n - a
while True:
	if is_comp(a) and is_comp(b):
		(print(a, end=' '), print(b, end=' '))
		break
	else:
		a -= 1
		b += 1


n = int(input())
x = 0
y = 0

def isComposite(num):
	num = int(num)
	count = 0
	if num == 1:
		return False
	for x in range(2, num):
		if num % x == 0:
			count = count + 1
	if count >= 1:
		return True
	else:
		return False
for i in range(2, n):
	if isComposite(i) == True:
		x = i
		y = n - x
		if isComposite(y) == True:
			break
		else:
			continue
print(x, y)


import math

def judge(a):
	for i in range(2, a // 2 + 1):
		if a % i == 0:
			return True
			break
	else:
		return False
num = int(input())
N = num // 2
for n in range(100000):
	if judge(N + n) and judge(num - N - n):
		print(N + n, num - N - n)
		break


n = int(input())
if n <= 11:
	if n == 8:
		print('4 4')
	if n == 10:
		print('4 6')
	else:
		print('-1')
if n % 2 == 0:
	print('4 ', n - 4)
else:
	print('9 ', n - 9)


number = int(input())
results = [(2, 4), (3, 4), (0, 2), (0, 3), (0, 4), (2, 3)]
remainder = number % 6
if remainder <= 1:
	quotient = (number - sum(results[remainder])) // 6
else:
	quotient = (number - sum(results[remainder])) // 6
if quotient:
	j = 1
	k = quotient - 1
else:
	j = 0
	k = 0
print(6 * j + results[remainder][0], 6 * k + results[remainder][1])


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
n = ii()
x = n % 2 * 5 + 4
y = n - x
print(x, y)


n = int(input())
if (n - 4) % 3 == 0:
	print('4 ' + str(n - 4))
elif (n - 6) % 3 == 0:
	print('6 ' + str(n - 6))
elif (n - 8) % 3 == 0:
	print('8 ' + str(n - 8))


def is_prime(n):
	if n == 2 or n == 3:
		return True
	if n < 2 or n % 2 == 0:
		return False
	if n < 9:
		return True
	if n % 3 == 0:
		return False
	r = int(n ** 0.5)
	f = 5
	while f <= r:
		if n % f == 0:
			return False
		if n % (f + 2) == 0:
			return False
		f += 6
	return True
n = int(input())
mid = n // 2
(a, b) = (mid, n - mid)
(cond_a, cond_b) = (is_prime(a), is_prime(b))
while cond_a or cond_b:
	(a, b) = (a - 1, b + 1)
	(cond_a, cond_b) = (is_prime(a), is_prime(b))
print(a, b)


a = int(input())
if a % 2 == 0:
	b = a % 2 + 8
	ans = a - b
	print(b, a - b)
if a % 2 != 0:
	b = a % 2 + 8
	ans = a - b
	print(b, a - b)


import math

def isPrime(n):
	return all((n % i for i in range(2, n)))
n = int(input())
for i in range(4, n // 2 + 1):
	if not isPrime(i) and (not isPrime(n - i)):
		print(i, n - i)
		break


import math
n = int(input())

def composite(x):
	if x % 2 == 0:
		return True
	elif x % 3 == 0:
		return True
	else:
		for i in range(5, math.floor(math.sqrt(x)) + 1):
			if x % i == 0:
				return True
	return False
if n % 2 == 0:
	while True:
		for i in range(n // 2, 1, -1):
			if composite(i) and composite(n - i):
				print(str(i) + ' ' + str(n - i))
				quit()
else:
	while True:
		for i in range((n - 1) // 2, 1, -1):
			if composite(i) and composite(n - i):
				print(str(i) + ' ' + str(n - i))
				quit()


n = int(input())
primes = set()
composite = set()
for i in range(2, n + 1):
	if i in composite:
		continue
	primes.add(i)
	for j in range(2 * i, n + 1, i):
		composite.add(j)
for i in composite:
	comp = n - i
	if comp in composite:
		print(i, comp)
		break


def compostos(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = True
	prime[1] = True
	prime[2] = True
	return prime
n = int(input())
compostos_ = compostos(n)
r = n - 1
l = 0
if n % 2 == 0 and (not compostos_[n // 2]):
	print(n // 2, n // 2)
else:
	while True:
		if compostos_[l]:
			l += 1
		elif compostos_[r]:
			r -= 1
		elif r + l > n:
			r -= 1
		elif r + l < n:
			l += 1
		else:
			break
	print(r, l)


def prime(num):
	for i in range(2, num):
		if num % i == 0:
			return 1
	return 0
n = int(input())
a = 4
b = n - 4
for i in range(4, n):
	a1 = prime(a)
	b1 = prime(b)
	if a1 == 1 and b1 == 1:
		print('{} {}'.format(a, b))
		break
	a += 1
	b -= 1


def main():
	n = int(input())
	if n % 2:
		print(9, n - 9)
	else:
		print(8, n - 8)
main()


a = int(input())
l = 1000001
check = [True for i in range(l)]
check[0] = False
check[1] = False
end = int(l / 2)
for i in range(2, end):
	if check[i]:
		for j in range(2 * i, l, i):
			check[j] = False
if a % 2 == 0:
	print('4 {}'.format(a - 4))
else:
	temp = int((a + 1) / 2)
	for i in range(4, temp):
		if check[i] == False and check[a - i] == False:
			print('{} {}'.format(i, a - i))
			break


def composite(n):
	for i in range(n):
		if i > 1 and n % i == 0:
			return 1
	return 0
n = int(input())
for i in range(n):
	if i != 0 and composite(i) and composite(n - i):
		print(str(i) + ' ' + str(n - i))
		break


n = int(input())
a = n - 4
b = n - 6
c = n - 8
if a % 3 == 0:
	print(a, n - a)
elif b % 3 == 0:
	print(b, n - b)
elif c % 3 == 0:
	print(c, n - c)


import math

def isPrime(num):
	for i in range(2, math.ceil(num / 2) + 1):
		if num % i == 0:
			return True
	return False
n = int(input())
for i in range(4, math.ceil(n / 2)):
	x = i
	y = n - x
	if isPrime(x) and isPrime(y):
		print(x, end=' ')
		print(y)
		break


a = [0] * 1000100
b = [True] * 1000100
a[1] = False
for i in range(2, 1000000):
	if b[i]:
		for j in range(i + i, 1000000, i):
			b[j] = False
n = eval(input())
k = (n + 1) // 2
for i in range(k, 1, -1):
	if not b[i] and (not b[n - i]):
		print(i, n - i)
		break


n = int(input())
d = 4
if n % 2 == 1:
	d = 9
print('%d %d' % (d, n - d))


import math

def heshu(x):
	for i in range(2, math.floor(math.sqrt(x)) + 1):
		if x % i == 0:
			return True
			break
	return False
n = int(input())
for i in range(2, n // 2 + 1):
	if heshu(i) and heshu(n - i):
		print(str(i), str(n - i))
		break


n = int(input())
if n % 2 is 0:
	print('4 ' + str(n - 4))
else:
	print('9 ' + str(n - 9))


import math

def isPrime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n // 2 + 1):
	if isPrime(i) and isPrime(n - i):
		print(i, n - i)
		raise SystemExit


a = int(input())
z = 0
x = 4
y = a - 4
while True:
	for i in range(2, x):
		if x % i == 0:
			z += 1
			break
	for i in range(2, y):
		if y % i == 0:
			z += 1
			break
	if z == 2:
		break
	else:
		z = 0
		x += 1
		y -= 1
print(x, y)


n = int(input())
p = n // 2
for j in range(n // 2):
	if n % 2 == 0:
		a = n // 2 + j
		b = n // 2 - j
	elif n % 2 != 0:
		a = n // 2 + j + 1
		b = n // 2 - j
	t = 0
	if a % 2 == 0 or a % 3 == 0 or a % 5 == 0 or (a % 7 == 0):
		if a != 2 and a != 3 and (a != 5) and (a != 7):
			t += 1
	if b % 2 == 0 or b % 3 == 0 or b % 5 == 0 or (b % 7 == 0):
		if b != 2 and b != 3 and (b != 5) and (b != 7):
			t += 1
	if t == 2:
		print(a, b)
		break


def primes(n):
	lst = list(range(0, n // 2))
	for i in range(2, len(lst)):
		for j in range(2 * i, len(lst), i):
			lst[j] = 0
	yield from lst

def main():
	n = int(input())
	if n % 2 == 0:
		print(4, n - 4)
	else:
		for i in range(9, n, 2):
			if i not in primes(n):
				print(i, n - i)
				break
main()


x = int(input(''))
if x == 13:
	print(9, 4)
	exit()
y = x / 2
if y / 2 == int(y / 2):
	print(int(y), int(y))
	exit()
elif x / 2 == int(x / 2):
	m = y + 1
	for i in range(100):
		n = x - m
		if (n % 2 == 0 or n % 3 == 0 or n % 5 == 0) and (m % 2 == 0 or m % 3 == 0 or m % 5 == 0):
			print(int(m), int(n))
			exit()
		else:
			m += 1
else:
	m = y + 0.5
	for c in range(100):
		n = x - m
		if (n % 2 == 0 or n % 3 == 0 or n % 5 == 0) and (m % 2 == 0 or m % 3 == 0 or m % 5 == 0):
			print(int(m), int(n))
			exit()
		else:
			m += 1


def is_prime(n):
	if n == 2:
		return True
	elif n % 2 == 0:
		return False
	else:
		for i in range(3, n + 1, 2):
			if n % i == 0 and n != i:
				return False
		return True
n = int(input())
for i in range(2, n + 1):
	if not is_prime(i) and (not is_prime(n - i)):
		print(str(i) + ' ' + str(n - i))
		break


def isprime(n):
	flag = False
	for i in range(2, n - 1):
		if n % i == 0:
			flag = True
	return flag
n = int(input())
if n % 2 == 0 and isprime(int(n / 2)) == True:
	print(int(n / 2), int(n / 2))
else:
	value = 0
	for i in range(1, n):
		k = n // 2 + i
		if isprime(n - k) == True and isprime(k) == True:
			l = n - k
			print(int(k), int(l))
			break
		else:
			continue


n = int(input())
if n % 2 == 0:
	k = [n - 4, 4]
else:
	k = [n - 9, 9]
for i in range(2):
	print(int(k[i]), end=' ')


def isprime(n):
	if n % 2 == 0:
		return n == 2
	d = 3
	while d * d <= n and n % d != 0:
		d += 2
	return d * d > n
n = int(input())
for i in range(4, n):
	if not isprime(i):
		if not isprime(n - i):
			print(i, n - i)
			exit()


c = int(input())
if c % 2 != 0:
	print(9, c - 9)
else:
	print(8, c - 8)


def chprime(p):
	if p > 1:
		for i1 in range(2, p // 2):
			if p % i1 == 0:
				return 1
		else:
			return 0
	else:
		return 1
a = int(input())
if a == 13:
	print('9 4')
else:
	for i in range(4, a):
		k = a - i
		if chprime(i) and chprime(k):
			print(i, end=' ')
			print(k)
			break


n = int(input())
a = 0
b = 0
for i in range(4, n):
	r = n - i
	for i2 in range(2, i):
		if i % i2 == 0 and i > i2:
			a = i
			break
	for i3 in range(2, r):
		if r % i3 == 0 and r > i3:
			b = r
			break
	if a + b == n:
		print(a, b)
		break


def isprime(n):
	k = int(n ** 0.5)
	for i in range(2, k + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n // 2 + 1):
	if not isprime(i) and (not isprime(n - i)):
		print(i, end=' ')
		print(n - i)
		break


def isCompl(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return True
		i += 1
	return False
n = int(input())
for i in range(4, n // 2 + 1):
	if isCompl(i) and isCompl(n - i):
		print(i, n - i)
		break


def composite(r):
	for i in range(2, r):
		if int(r % i) == 0:
			return 1
	return 0
n = int(input())
c = 4
while 1:
	if composite(c):
		if composite(n - c):
			break
	c += 1
print(c, n - c)


n = int(input())
c = n % 2 + 8
print(c, n - c)


nStr = input()
n = int(nStr)

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
fA = n // 2
fB = n - fA
while isPrime(fA) or isPrime(fB):
	fA = fA - 1
	fB = fB + 1
print(fA, fB)


n = int(input())
result = 0
a = 0
b = 0

def is_prime(i):
	for k in range(2, i):
		if i % k == 0:
			return False
	return True
for i in range(1, int(n / 2) + 1):
	if not is_prime(i) and (not is_prime(n - i)):
		a = i
		b = n - i
		break
print(a, ' ', b)


n = int(input())
primeNum = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]

def checkPrime(p):
	res = True
	for prime in primeNum:
		if p % prime == 0 and p > 3 and (p != prime):
			res = False
	return res
x = 4
y = n - 4
res = checkPrime(y)
while res:
	x += 2
	y -= 2
	res = checkPrime(y)
print(x, y)


n = int(input())

def prime(n):
	for x in range(2, n):
		if n % x == 0:
			ans = 0
			return ans
			break
		else:
			continue
	return 1
for x in range(4, 100):
	if prime(x) == 0 and prime(n - x) == 0:
		print(x, n - x)
		break
	else:
		continue


import math

def divi(l):
	i = 0
	div = []
	while l % 2 == 0:
		l /= 2
		div.append(2)
	for i in range(1, int(math.sqrt(l)) + 1, 2):
		if l % i == 0:
			div.append(i)
			l /= i
	if l > 2:
		div.append(l)
	if len(div) > 2:
		return 'g'
	else:
		return 'l'
n = int(input())
x = 0
y = 0
j = 2
while 1:
	if divi(j) == 'g' and divi(n - j) == 'g':
		x = j
		y = n - j
		break
	else:
		j += 2
print(x, y)


def prime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
i = 4
while True:
	if prime(n - i) == False:
		print(i, n - i)
		break
	i += 2


n = int(input())

def jp(x):
	b = 0
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			b = 1
			return b
			break
	if b == 0:
		return 0
for i in range(n // 2 + 1):
	if jp(i) == 1 and jp(n - i) == 1:
		print(str(i) + ' ' + str(n - i))
		break


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = input()
n = int(n)
if n >= 12:
	if n % 2 == 0:
		if isPrime(n / 2) == False:
			print(int(n / 2), ' ', int(n / 2))
		else:
			print(int((n - 2) / 2), ' ', int((n + 2) / 2))
	else:
		b = n - 4
		if isPrime(b) == False and isPrime(n - b) == False:
			print(int(b), ' ', int(n - b))
		else:
			b = n - 6
			if isPrime(b) == False and isPrime(n - b) == False:
				print(int(b), ' ', int(n - b))
			else:
				b = n - 8
				if isPrime(b) == False and isPrime(n - b) == False:
					print(int(b), ' ', int(n - b))


n = int(input())

def isntPrime(n):
	if n <= 1:
		return True
	i = 2
	while i * i <= n:
		if n % i == 0:
			return True
		i += 1
	return False
if n % 2 == 0:
	print('4' + ' ' + str(n - 4))
elif isntPrime(n - 4):
	print('4' + ' ' + str(n - 4))
elif isntPrime(n - 6):
	print('6' + ' ' + str(n - 6))
elif isntPrime(n - 8):
	print('8' + ' ' + str(n - 8))
elif isntPrime(n - 10):
	print('10' + ' ' + str(n - 10))


a = int(input())

def is_prime(y):
	for z in range(2, y):
		if y % z == 0:
			return True
		elif z == y - 1:
			return False
if a % 2 == 0:
	(b, c) = (a / 2, a / 2)
	if b % 2 == 0 and c % 2 == 0:
		print(int(b), int(c))
	else:
		print(int(b - 1), int(c + 1))
else:
	(b, c) = (a // 2, a // 2 + 1)
	while True:
		if is_prime(b) and is_prime(c):
			print(int(b), int(c))
			break
		else:
			b -= 1
			c += 1


try:
	n = int(input())
	if n % 2 == 0:
		print('8', n - 8)
	else:
		print('9', n - 9)
except EOFError:
	pass


n = int(input())
primes = [2, 3, 5, 7]

def prime(x):
	if x not in primes:
		for p in primes:
			if x % p == 0:
				return False
	return True
for x in range(11, 1000, 2):
	if prime(x):
		primes.append(x)
for x in range(4, n - 4):
	y = n - x
	if not prime(x) and (not prime(y)):
		print(x, y)
		break


r = int(input()) - 9
print(*((9, r) if r % 2 == 0 else (8, r + 1)))


number = int(input())
for i in range(4, number, 2):
	test = False
	incog = number - i
	j = 2
	while j * j <= incog:
		if incog % j == 0:
			test = True
			break
		j += 1
	if test:
		print(str(i) + ' ' + str(number - i))
		break


n = int(input())
if n % 4 == 0:
	a = n // 2
	print(a, a, sep=' ')
elif n % 3 == 0:
	a = n // 3
	b = (a - 2) * 3
	print(b, 6, sep=' ')
else:
	a = 0
	while n % 3 != 0:
		a += 4
		n -= 4
	print(n, a, sep=' ')


a = int(input())
list1 = []
if a % 2 == 0:
	list1.append(str(4))
	list1.append(str(a - 4))
else:
	list1.append(str(9))
	list1.append(str(a - 9))
print(' '.join(list1))


a = int(input())
x = 0
y = 0

def is_prime(n):
	if n == 2 or n == 3:
		return True
	if n < 2 or n % 2 == 0:
		return False
	if n < 9:
		return True
	if n % 3 == 0:
		return False
	r = int(n ** 0.5)
	f = 5
	while f <= r:
		if n % f == 0:
			return False
		if n % (f + 2) == 0:
			return False
		f += 6
	return True
for i in range(4, 1000000, 2):
	x = i
	y = a - i
	if is_prime(y):
		continue
	else:
		print(str(x) + ' ' + str(y))
		exit()


N = int(input())
k = 0
p = 0
if N % 2 == 0:
	k = 8
	p = N - 8
else:
	k = 9
	p = N - 9
print(k, p)


n = int(input())
if n % 2 == 0:
	l = [4, n - 4]
	print(*l)
else:
	r = [9, n - 9]
	print(*r)


def isPrime(n):
	if n % 2 == 0:
		return n == 2
	d = 3
	while d * d <= n and n % d != 0:
		d += 2
	return d * d > n
n = int(input())
f = 0
if n % 2 == 0:
	x1 = n // 2
	x2 = n // 2
	if not isPrime(x1):
		print(x1, x2, sep=' ')
	else:
		while f == 0 and x1 > 0:
			x1 -= 1
			x2 += 1
			if not isPrime(x1) and (not isPrime(x2)):
				f = 1
		print(x1, x2, sep=' ')
else:
	x1 = n // 2
	x2 = x1 + 1
	if not isPrime(x1) and (not isPrime(x2)):
		print(x1, x2, sep=' ')
	else:
		while f == 0 and x1 > 0:
			x1 -= 1
			x2 += 1
			if not isPrime(x1) and (not isPrime(x2)):
				f = 1
		print(x1, x2, sep=' ')


def is_prime(n):
	if n % 2 == 0 or n % 3 == 0:
		return False
	for i in range(5, n):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(4, n):
	if not (is_prime(i) or is_prime(n - i)):
		print(i, end=' ')
		print(n - i, end='')
		break


def isComp(n):
	for i in range(2, n // 2):
		if n % i == 0:
			return 1
	return 0
n = int(input())
if n % 2:
	for i in range(n - 3, 2, -1):
		if i % 2 and isComp(i):
			print(i, n - i)
			break
elif isComp(n // 2):
	print(n // 2, n // 2)
else:
	print(n // 2 + 1, n // 2 - 1)


x = int(input())
i = 4
bol = True
while bol == True:
	y = x - i
	if y % 2 == 0 and i % 2 == 0 or (y % 3 == 0 and i % 3 == 0):
		print(y, i)
		bol = False
	elif y % 3 == 0 and i % 2 == 0 or (y % 2 == 0 and i % 3 == 0):
		print(y, i)
		bol = False
	i += 1


def isOdd(x):
	if x % 2 == 0:
		return False
	else:
		return True

def main():
	num = int(input())
	if isOdd(num):
		print('9 ' + str(num - 9))
	else:
		print('4 ' + str(num - 4))
main()


input = int(input())
if input % 2 == 0:
	x = int(input / 2)
	if x % 2 == 0:
		print(x, x)
	else:
		print(x - 1, x + 1)
else:
	print(min(9, input - 9), max(9, input - 9))


def comp(a):
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return True
	else:
		return False
n = int(input())
x = n // 2
while x >= 4:
	if comp(x) and comp(n - x):
		print(str(x) + ' ' + str(n - x))
		break
	else:
		x -= 1


n = int(input())
if (n - 4) % 3 == 0:
	print(4, n - 4)
elif (n - 6) % 3 == 0:
	print(6, n - 6)
else:
	print(8, n - 8)


n = int(input())
r = 0
a = 4
b = n - a

def composite(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
while r == 0:
	if composite(a) == True and composite(b) == True:
		print(a, b)
		r = 1
	else:
		a = a + 1
		b = b - 1


x = int(input())
val = int(x / 2)
if x % 2 == 0:
	val1 = val
else:
	val1 = val + 1
it = int(val / 2) + 1
out = 0
proceed = 0
while 1:
	proceed = 0
	for i in range(2, it):
		if val % i == 0:
			proceed = 1
			for j in range(2, it):
				if val1 % j == 0:
					out += 1
					print(val, val1)
					break
		if proceed and out == 0:
			val -= 1
			val1 += 1
			break
		else:
			val -= 1
			val1 += 1
			break
	if out == 1:
		break


from math import sqrt

def GCD(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	else:
		return GCD(b, a % b)

def is_prime(n: int) -> bool:
	for i in range(2, int(n)):
		if i < n and n % i == 0:
			return False
	return True
n = int(input())
for curr in range(2, n):
	if not is_prime(curr) and (not is_prime(n - curr)):
		print(curr, n - curr)
		break


def p(n):
	s = 0
	for i in range(2, n):
		s = s + (n % i == 0)
	return s == 0
x = int(input())
for i in range(1, x):
	if p(i) == 0 and p(x - i) == 0:
		print(i, x - i)
		raise SystemExit


n = int(input())
n1 = 4
n2 = n - n1
if n % 2 == 0:
	print('4', n - 4)
else:
	for i in range(int((n - 4 - 3) / 2)):
		c = 0
		d = 0
		for r in range(2, n1):
			if n1 % r == 0:
				c += 1
		for g in range(2, n2):
			if n2 % g == 0:
				d += 1
		if c > 0 and d > 0:
			print(n1, n2)
			break
		n1 += 1
		n2 -= 1


def prime(a, b):
	arr = [2, 3, 5, 7, 11]
	for i in range(a, n):
		for j in range(2, i):
			if i % j == 0:
				break
		else:
			arr.append(i)
	return arr
n = int(input())
if n % 2 == 0:
	print(4, n - 4)
else:
	arr = prime(n - 10, n)
	(a, b) = (4, n - 4)
	while True:
		if a not in arr and b not in arr:
			print(a, b)
			break
		else:
			a += 1
			b -= 1


n = int(input())
a = n // 2
b = n - a
while a > 2 and b > 2 and (a + b == n):
	c = 0
	d = 0
	for i in range(2, a // 2 + 1):
		if a % i == 0:
			c = c + 1
	for i in range(2, b // 2 + 1):
		if b % i == 0:
			d = d + 1
	if c > 0 and d > 0:
		print(a, end=' ')
		print(b)
		break
	else:
		a = a - 1
		b = b + 1


def function1(n):
	if n % 2 == 0:
		return str(4) + ' ' + str(n - 4)
	else:
		return str(9) + ' ' + str(n - 9)
	pass

def main():
	print(function1(int(input())))
main()


n = int(input())

def sost(n):
	d = 2
	while d * d <= n and n % d != 0:
		d += 1
	return d * d < n
if n % 2 == 0:
	a = round(n / 2)
	if sost(a):
		print(a, a)
	else:
		print(n - 4, n - (n - 4))
else:
	print(n - 9, n - (n - 9))


def com(n):
	f = 0
	for i in range(2, n):
		if n % i == 0:
			break
	else:
		f = 1
	return f
n = int(input())
for i in range(4, n // 2 + 1):
	a = i
	b = n - i
	if com(a) != 1 and com(b) != 1:
		break
print(a, b)


n = int(input())
x = 6
diff = n - x
if diff % 3 == 0:
	print(x, diff)
elif diff % 3 == 1:
	print(x - 2, diff + 2)
else:
	print(x + 2, diff - 2)


n = int(input())
x = y = 0
for i in range(4, n):
	if i % 3 == 0 and (i - n) % 2 == 0:
		x = i
		y = n - i
		break
print(x, y)


n = int(input())

def prime(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return 0
	return 1

def check(n):
	for i in range(2, n // 2 + 1):
		if prime(i) == 0:
			if prime(n - i) == 0:
				print(i, n - i)
				break
check(n)


q = int(input())
print('4 ' + str(q - 4) if q % 2 == 0 else '9 ' + str(q - 9))


n = int(input())
x = [4, 6, 8, 9, 10]
for i in range(12, n):
	if (i - 1) % 6 == 0 or (i + 1) % 6 == 0:
		continue
	else:
		x.append(i)
for item in x:
	if n - item in x:
		print(item, n - item)
		break
	else:
		continue


def simple(a):
	if a % 2 == 0:
		return a == 2
	d = 3
	while d ** 2 < a and a % d != 0:
		d += 1
	return d ** 2 > a and a > 2
n = int(input())
for i in range(4, n):
	if not simple(i) and (not simple(n - i)):
		print(i, n - i)
		break


import math
n = int(input())
a = 0
b = 0
for i in range(6, n + 1):
	for j in range(2, math.floor(i ** 0.5) + 1):
		if i % j == 0:
			a = 1
			break
	for j in range(2, math.floor((n - i) ** 0.5) + 1):
		if (n - i) % j == 0:
			b = 1
			break
	if a * b == 1:
		print(i, n - i)
		break
	else:
		a = 0
		b = 0


import math

def is_composite(n):
	for i in range(2, int(math.sqrt(n) + 1)):
		if n % i == 0:
			return True
	return False
n = int(input())
for i in range(4, n):
	if is_composite(i) and is_composite(n - i):
		print(i, n - i)
		break


import math

def judge_prime(n):
	for i in range(2, math.floor(n / 2) + 1):
		if n % i == 0:
			return True
	return False
sum = eval(input())
if sum % 2 == 0:
	n = sum / 2
	m = n
else:
	n = sum // 2
	m = n + 1
while True:
	if judge_prime(n) and judge_prime(m):
		print('%d %d' % (n, m), end='')
		break
	else:
		n -= 1
		m += 1


a = int(input())

def proverka(k, q):
	if (k % 2 == 0 or k % 3 == 0) and (q % 2 == 0 or q % 3 == 0):
		return True
	else:
		return False
x = 4
while True:
	y = a - x
	if proverka(x, y):
		print(x, y)
		break
	else:
		x += 1


from math import floor, ceil
n = int(input())
if n % 2 == 0:
	print(6, n - 6)
else:
	print(9, n - 9)


def seperateints(x):
	k = ''
	l = []
	for i in x:
		if i == ' ':
			l.append(int(k))
			k = ''
			continue
		k = k + i
	l.append(int(k))
	return l

def luckynum(x):
	for i in x:
		if i != '4' and i != '7':
			return False
	return True
n = int(input())
if n % 2 == 0:
	print(str(8) + ' ' + str(n - 8))
else:
	print(str(9) + ' ' + str(n - 9))


def is_composite(num):
	for i in range(2, num):
		if not num % i:
			return i
	return 0

def solution(num):
	for i in range(4, num):
		if is_composite(i) and is_composite(num - i):
			return (i, num - i)
	return 0
print(*solution(int(input())))


a = int(input(''))
if a % 2 == 0:
	c = a - 8
	print('8', c)
else:
	d = a - 9
	print('9', d)


def iscomp(n):
	c = 0
	for i in range(1, n // 2 + 1):
		if n % i == 0:
			c = c + 1
	if c != 1:
		return True
	else:
		return False
n = int(input())
for i in range(4, n):
	num = i
	n1 = n - num
	if iscomp(num) and iscomp(n1):
		print(num, n1)
		break


x = int(input())
for (i, j) in zip(range(1, x), range(x - 1, -1, -1)):
	if (i % 2 == 0 or i % 3 == 0) and (j % 2 == 0 or j % 3 == 0) and (i != 3) and (j != 3) and (i != 2) and (j != 2):
		print(i, j)
		break


def checkComp(n):
	if n == 2 or n == 3:
		return 0
	elif n % 2 == 0 or n % 3 == 0:
		return 1
	for x in range(2, n // 2):
		if n % x == 0:
			return 1
	return 0
n = int(input())
for i in range(4, n):
	if checkComp(i) and checkComp(n - i):
		print(i, n - i)
		break


n = int(input())
k = 0

def func(n):
	d = n // 2
	for i in range(d, n):
		for j in range(2, i):
			if i % j == 0 and i != j:
				k = n - i
				for j in range(2, k):
					if k % j == 0:
						return k
ans = func(n)
print(ans, n - ans)


import cmath
import math

def prime(m):
	p = 0
	for i in range(2, math.ceil(cmath.sqrt(m).real) + 1):
		if m % i == 0:
			p += 1
	if p == 0:
		return 0
	else:
		return 1
n = int(input())
for i in range(3, n):
	if prime(i) == 1 and prime(n - i) == 1:
		print(i, n - i)
		exit()


def main():
	number = input()
	last = number[-1]
	if int(last) % 2 == 0:
		print(4, int(number) - 4)
	else:
		print(9, int(number) - 9)
main()


n = int(input())
print(9, n - 9) if bool(n & 1) else print(4, n - 4)


def isprime(n):
	count = 0
	if n <= 3:
		return 1
	t = int(n ** 0.5)
	for i in range(2, t + 1):
		if n % i == 0:
			return 0
	if count == 0:
		return 1
n = int(input())
for i in range(4, n):
	if isprime(i) == 0 and isprime(n - i) == 0:
		print(i, n - i)
		break


def is_prime(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return False
	return True

def is_compound(n):
	return not is_prime(n)
num = int(input())
for i in range(4, num // 2 + 1):
	if is_compound(i) and is_compound(num - i):
		print(i, num - i)
		break


num = int(input())

def iscomp(num):
	if num > 1:
		for i in range(2, num):
			if num % i == 0:
				return True
				break
for i in range(num):
	if iscomp(i) == True:
		if iscomp(num - i) == True:
			print(i, num - i)
			break


def main():
	n = int(input())
	X = (4, 6, 8)
	for i in X:
		if (n - i) % 3 == 0:
			print(i, n - i)
			break
main()


def is_prime(number):
	if number <= 1:
		return False
	for x in range(2, number):
		if not number % x:
			return False
	return True
val = int(input())
mod = 0
for i in range(4, val):
	a = val - i
	if is_prime(i) == False and is_prime(a) == False:
		print(i, a)
		break


n = int(input())

def ProstCh(i, n):
	d = 2
	while d * d < i and i % d != 0:
		d += 1
	return i % d != 0
for i in range(n - 4, 3, -1):
	if ProstCh(i, n) == False:
		b = n - i
		if ProstCh(b, n) == False:
			print(b, i)
			break


N = int(input())
if N % 10 == 0:
	print(int(N / 2), int(N / 2))
else:
	lista = [int(i) for i in range(N) if i >= 4 and i != 5 and (i != 7) and (i % 2 == 0 or i % 3 == 0 or i % 5 == 0 or (i % 7 == 0) or (i % 9 == 0))]
	(ans1, ans2) = (0, 0)
	for i in range(len(lista)):
		for j in range(-1, len(lista)):
			if lista[i] + lista[j] == N:
				(ans1, ans2) = (lista[i], lista[j])
				break
		if ans1 != 0:
			break
	print(ans1, ans2)


def isPrime(x):
	if x < 2:
		return False
	else:
		i = 2
		while i < x:
			if x % i == 0:
				return False
			i += 1
		return True
n = int(input())
if n % 4 == 0:
	print(n // 2, n // 2)
else:
	a = n // 2
	b = n - a
	while a > 1 and b < n:
		if not isPrime(a) and (not isPrime(b)):
			print(a, b)
			break
		a -= 1
		b = n - a


import math
n = int(input())

def cheak(num):
	for i in range(2, math.ceil(math.sqrt(num)) + 1):
		if num % i == 0:
			return True
for i in range(4, n):
	num = n - i
	if cheak(num) and cheak(i):
		print(i, num)
		break


n = int(input())
if n <= 11:
	if n == 8:
		print('4 4', end=' ')
	elif n == 10:
		print('4 6', end=' ')
elif n % 2 == 0:
	print('4 ', n - 4, end=' ')
else:
	print('9 ', n - 9, end=' ')


primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709]
num = int(input())
loop = True

def checkIfDivisbleByAnyList(aNum, aList):
	flag = False
	for i in aList:
		if aNum % i == 0 and i != aNum:
			flag = True
	return flag
if num % 2 == 0 and checkIfDivisbleByAnyList(num // 2, primes):
	print(num // 2, num // 2)
else:
	k = 4
	while loop:
		if checkIfDivisbleByAnyList(num - k, primes):
			print(k, num - k)
			loop = False
		else:
			k += 2
			while not checkIfDivisbleByAnyList(k, primes):
				k += 2


number = int(input())
modsix = number % 6
if modsix == 0:
	y = 6
if modsix == 1:
	y = 4
if modsix == 2:
	y = 8
if modsix == 3:
	y = 6
if modsix == 4:
	y = 4
if modsix == 5:
	y = 8
x = number - y
print(str(x) + ' ' + str(y))


n = int(input())
is_prime = lambda n: all((n % i != 0 for i in range(2, int(n ** 0.5) + 1)))
(x, y) = (n // 2, n // 2 if n % 2 == 0 else n // 2 + 1)
while is_prime(x) or is_prime(y):
	(x, y) = (x - 1, y + 1)
print(x, y)


def comp(num):
	counter = 0
	if num >= 4 and num < 1000000:
		for i in range(1, num + 1):
			if num % i == 0:
				counter += 1
		if counter > 2:
			return True
		else:
			return False
n = int(input())
if n >= 12 and n <= 1000000:
	from random import randint
	a = 0
	b = 0
	while comp(a) != True or comp(b) != True:
		a = randint(4, n - 4)
		b = n - a
	if comp(a) == True and comp(b) == True:
		print(str(a) + ' ' + str(b))


n = int(input())
if n % 2 == 0:
	a = n - 4
	print(a, 4)
else:
	g = n - 9
	print(9, g)


import math

def pos_div(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return True
	else:
		return False
n = int(input())
x = 0
y = 0
for i in range(4, n - 1):
	if i + (n - i) == n:
		x = i
		if pos_div(x) == False:
			continue
		y = n - i
		if pos_div(y) == False:
			continue
		print(x, y)
		break
else:
	print()


import math
import itertools
gh = lambda : map(int, input().split())

def IsPrime(x):
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return False
	return True

def main():
	n = int(input())
	for i in range(4, n // 2 + 1):
		t1 = IsPrime(i)
		t2 = IsPrime(n - i)
		if t1 == 0 and t2 == 0:
			print(i, n - i)
			return
main()


class GettingComplex(object):

	def __init__(self):
		self.n = int(input())

	def complex_numbers(self):
		while True:
			try:
				assert 12 <= self.n <= 10 ** 6
				l_digit = self.n % 10
			except ValueError as error:
				print('ValueError: ' + str(error))
				print('try again')
			except AssertionError:
				print('Please enter a value ranging from 1 to 100')
			else:
				if l_digit == 7:
					GettingComplex.num_print(self, 9)
				elif l_digit == 9:
					GettingComplex.num_print(self, 4)
				elif self.n == 13:
					GettingComplex.num_print(self, 4)
				elif self.n == 23:
					GettingComplex.num_print(self, 8)
				elif self.n == 15:
					GettingComplex.num_print(self, 6)
				elif self.n == 21:
					GettingComplex.num_print(self, 6)
				elif self.n == 33:
					GettingComplex.num_print(self, 6)
				elif l_digit == 1 and self.n > 21:
					GettingComplex.num_print(self, 21)
				elif l_digit == 3 and self.n > 33:
					GettingComplex.num_print(self, 33)
				elif l_digit == 5 and self.n > 15:
					GettingComplex.num_print(self, 15)
				elif l_digit % 2 == 0:
					GettingComplex.num_print(self, 4)
				break

	def num_print(self, a):
		b = self.n - a
		print(a, b)
run = GettingComplex()
run.complex_numbers()


n = int(input())
prime = [2, 3, 5, 7, 11]
flag_x = True
flag_y = True
x = n // 2
y = n - n // 2
while flag_x or flag_y:
	flag_x = True
	flag_y = True
	for i in prime:
		if x % i == 0 and x not in prime:
			flag_x = False
			break
	for i in prime:
		if y % i == 0 and y not in prime:
			flag_y = False
			break
	if flag_x or flag_y:
		x -= 1
		y += 1
print(x, y)


def is_not_simple(a):
	f = True
	for i in range(2, a):
		if a % i == 0:
			f = False
			break
	return f
n = int(input())
for i in range(4, n // 2 + 1):
	if is_not_simple(i) == False and is_not_simple(n - i) == False:
		break
print(i, n - i)


import math

def isPrime(x):
	sqrtX = int(math.sqrt(x))
	for d in range(2, sqrtX + 1):
		if x % d == 0:
			return False
	return True
n = int(input())
for a in range(1, n // 2 + 1):
	if not isPrime(a) and (not isPrime(n - a)):
		print(a, n - a)
		break


n = int(input())
for i in range(4, n):
	x = n - i
	f1 = 0
	f2 = 0
	for j in range(i):
		if i == 6 * j - 1 or i == 6 * j + 1:
			f1 = 1
			break
	for j in range(x):
		if x == 6 * j - 1 or x == 6 * j + 1:
			f2 = 1
			break
	if f1 != 1 and f2 != 1:
		print(i, x)
		break


def check(n):
	f = 4
	while True:
		s = n - f
		for i in range(2, 10):
			if s % i == 0:
				print(f, s)
				exit()
		f += 2
check(int(input()))


def main():
	n = int(input())
	if n % 2 == 0:
		print('8 ' + str(n - 8))
	else:
		print('9 ' + str(n - 9))
main()


def isPrime(x):
	for i in range(2, x):
		if x % i == 0:
			return False
	return True
IN = int(input())
for i in range(4, IN - 4):
	if not isPrime(i) and (not isPrime(IN - i)):
		print(str(i) + ' ' + str(IN - i))
		exit()


n = int(input())
noprimes = list(set((j for i in range(2, 35) for j in range(i * 2, n, i))))

def solution(array):
	for i in array:
		for j in array:
			if i + j == n:
				return str(i) + ' ' + str(j)
print(solution(noprimes))


import math

def isprime(n):
	return n > 2 and all((n % x != 0 for x in range(2, math.floor(math.sqrt(n)) + 1)))
n = int(input())
found = False
x = 3
while not found:
	if not isprime(x) and (not isprime(n - x)):
		found = True
	else:
		x += 1
print(x, n - x)


def judge(a):
	k = 0
	for i in range(3, a):
		if a % i == 0:
			k = 1
	return k
x = int(input())
i = 2
a = 0
c = 1
if x % 2 == 0:
	print('4 ' + str(x - 4))
else:
	while judge(a) == 0:
		i = i + 2
		a = x - i
	print(str(i) + ' ' + str(x - i))


def check(n):
	a = [2, 3, 5, 7, 11]
	flag = 0
	if n in a:
		flag = 0
	elif n < 12:
		flag = 1
	elif n % 2 == 0:
		flag = 1
	else:
		for j in range(2, n // 2 + 1):
			if n % j == 0:
				flag = 1
	return flag
n = int(input())
if n % 4 == 0:
	print(n // 2, n // 2)
else:
	if n % 2 == 0:
		s = n // 2
		w = check(s)
		if w == 0:
			p = s + 1
			q = s - 1
		else:
			p = s
			q = s
	else:
		s = n // 2
		p = s
		q = s + 1
		x = check(p)
		if x == 0:
			if p > q:
				p = p + 1
				q = q - 1
			else:
				p = p - 1
				q = q + 1
		y = check(q)
		if y == 0:
			if q > p:
				q = q + 1
				p = p - 1
			else:
				q = q - 1
				p = p + 1
		z = check(p)
		if z == 0:
			if p > q:
				p = p + 1
				q = q - 1
			else:
				p = p - 1
				q = q + 1
		t = check(q)
		if t == 0:
			if q > p:
				q = q + 1
				p = p - 1
			else:
				q = q - 1
				p = p + 1
		u = check(p)
		if u == 0:
			if p > q:
				p = p + 1
				q = q - 1
			else:
				p = p - 1
				q = q + 1
		v = check(q)
		if v == 0:
			if q > p:
				q = q + 1
				p = p - 1
			else:
				q = q - 1
				p = p + 1
	print(p, q)


import sys

class Prime:

	def __init__(self):
		self.arr = set([1, 2])
		self.arrMax = 2

def checkPrime(a):
	return a > 1 and all((a % i for i in range(2, int(a ** 0.5) + 1)))

def main():
	val = int(sys.stdin.readline().strip())
	front = 2
	tail = val - 2
	while tail > front:
		if checkPrime(front) is False and checkPrime(tail) is False:
			print(str(front) + ' ' + str(tail))
			return
		else:
			front += 1
			tail -= 1
main()


def pr(x):
	fl = 1
	for n in range(2, int(x ** 0.5) + 2):
		if x % n == 0:
			fl = 0
			break
		else:
			fl = 1
	if x == 2:
		fl = 1
	return fl
x = int(input())
for n in range(4, x):
	if pr(n) == 0 and pr(x - n) == 0:
		print('{} {}'.format(n, x - n))
		break


import math

def is_prime(n):
	if n in {2, 3, 5, 7, 11, 13, 17}:
		return True
	else:
		s = math.sqrt(n)
		if s == int(s):
			return False
		if n % 2 == 0:
			return False
		i = 3
		while i < s:
			if n % i == 0:
				return False
			i += 2
		return True
n = int(input())
for x in range(2, n // 2 + 1):
	if not (is_prime(x) or is_prime(n - x)):
		print(x, n - x)
		break


n = int(input())
limit = 1000001
prime_flag = [True] * limit
prime_flag[0] = prime_flag[1] = False
for i in range(limit):
	if prime_flag[i] == True:
		for j in range(i * i, limit, i):
			prime_flag[j] = False
for i in range(2, n):
	if prime_flag[i] == False and prime_flag[n - i] == False:
		print(i, n - i)
		break


a = int(input())
print('9 ' + str(a - 9) if a % 2 == 1 else '8 ' + str(a - 8))


n = int(input())

def feisu(x):
	for i in range(2, x):
		if x % i == 0:
			return True
	return False
if n < 12:
	exit()
else:
	for i in range(n):
		if feisu(i):
			z = n - i
			if feisu(z):
				print(i, z)
				exit()


MAX = int(1000000.0) + 1
is_prime = [True for _ in range(MAX)]
for i in range(2, MAX):
	if is_prime[i]:
		for j in range(i + i, MAX, i):
			is_prime[j] = False
num = int(input())
fst = 1
snd = num - 1
found = False
while not found:
	if fst > snd:
		break
	if not is_prime[fst] and (not is_prime[snd]):
		break
	else:
		fst += 1
		snd -= 1
print('%d %d' % (fst, snd))


def main():
	(n,) = read()
	if n % 2:
		print(9, n - 9)
	else:
		print(4, n - 4)

def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return list(map(int, inputs.split()))

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
write(main())


import math

def check_if_composite_number(a):
	for i in range(2, int(pow(a, 0.5)) + 1):
		if a % i == 0:
			return True
	return False
input_value = int(input())
(x, y) = [input_value // 2, math.ceil(input_value / 2)]
while True:
	if check_if_composite_number(x) and check_if_composite_number(y):
		print(x, y)
		exit()
	if x > 1:
		x -= 1
	if y < input_value:
		y += 1


s = int(input())
if s % 2:
	print(9, s - 9)
else:
	print(4, s - 4)


def isPrime(n):
	if n < 4:
		return 1
	if n % 3:
		return 0
	i = 5
	while True:
		if n % i == 0:
			return 0
		i += 2
		if n % i == 0:
			return 0
		i += 4
		if i > n ** 0.5:
			return 1
N = int(input())
if N & 1 == 0:
	print('{} {}'.format(4, N - 4))
else:
	i = 4
	while not isPrime(N - i):
		i += 2
	print('{} {}'.format(i, N - i))


import math
n = int(input())
primes = [True for i in range(n + 1)]
for i in range(2, int(math.sqrt(n) + 1)):
	count = 1
	if primes[i]:
		for j in range(i * i, n + 1, i * count):
			primes[j] = False
			count += 1
(primes[0], primes[1])
for (number, prime) in enumerate(primes):
	if prime or number == 0 or number == 1:
		continue
	else:
		a = number
		if not primes[n - number]:
			b = n - number
			break
print(a, b)


def isPrime(n):
	Prime = True
	i = 2
	while i <= n ** 0.5 and Prime:
		Prime = bool(n % i)
		i += 1
		if i > 3:
			i += 1
	return Prime
x = int(input())
for b in range(4, x // 2 + 1, 2):
	a = x - b
	if not isPrime(a):
		print(a, b)
		exit()


import math
n = int(input())
if n % 2 == 0:
	a = 4
	b = n - a
else:
	a = 4
	b = n - a
while b % 3 % 2 != 0:
	b -= 2
t = b % 3
b = b - t
a = n - b
print(a, b)


def cmp(n):
	f = 0
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			f = 1
			break
	if f == 1:
		return 1
	else:
		return 0
n = int(input())
for i in range(n):
	j = n - i
	if cmp(i) == 1 and cmp(j) == 1:
		print(i, j)
		break