#-*- coding: utf- 8-*-
n = int(input())
a = 0
b = 0
if(n % 2 == 0):
    a = 6
    b = n - 6
else:
    a = 9
    b = n - 9
print(a, b)
64a38471936c2d3331f77f23b343fd1ddf4d3e7b
<mask token>

<mask token>
if n % 2 == 0:
    a = 6
    b = n - 6
else:
    a = 9
    b = n - 9
print(a, b)

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

#-*- coding: utf- 8-*-
n = int(input())
a = 0
b = 0
if(n % 2 == 0):
    a = 6
    b = n - 6
else:
    a = 9
    b = n - 9
print(a, b)