N = int(input()) L = [0]*(N+1) for i in range(1,N+1): for j in range(i,N+1,i): L[j]+=1 f = 10**10 for i in range(N+1): a = i b = N-a f = min(f,abs(a-L[a]-b+L[b])) for i in range(N+1): a = i b = N-a if abs(a-L[a]-b+L[b])==f: print(a,N-a)