x=int(input()) lis=[0]*(2*10**6+1) for i in range(1,2*10**6+1): for j in range(i,2*10**6+1,i): lis[j]+=1 ans=10**18 for a in range(1,x): b=x-a f_a=a-lis[a];f_b=b-lis[b] if ans>abs(f_a-f_b): ans=abs(f_a-f_b) for a in range(1,x): b=x-a if abs(a-lis[a]-b+lis[b])==ans: print(a,b)