while True: try: n = int(input()) a = n//2 list=[] for i in range(a,1,-1): for j in range(2,i): if i%j==0 or (n-i)%j==0: break else: list.append(i) print(list[0]) print(n-list[0]) except: break