d=[0]*(10**7) def f(n): if d[n]!=0: return d[n] l=[] for i in range(2,int(n**0.5)+1): if n%i==0: cnt=0 while n%i==0: cnt+=1 n//=i l.append((i,cnt)) if n>1: l.append((n,1)) ans=1 for k in l: ans*=(k[1]+1) d[n]=ans return ans x=int(input()) e=[[] for i in range(10**7)] q=10**18 for i in range(max(1,x//2-100),min(x,x//2+100)): r=abs(i-f(i)-(x-i)+f(x-i)) e[r].append((i,x-i)) q=min(q,r) for j in e[q]: print(j[0],j[1])