#109087175	Mar/04/2021 19:56UTC+5.5	Shan_XD	472A - Design Tutorial: Learn from Math	PyPy 3	Accepted	93 ms	0 KB

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