x=int(input()) #約数列挙 def make_divisors(n): divisors = [] for i in range(1, int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) divisors.sort() return divisors def f(a): return a-len(make_divisors(a)) ans=float("inf") cnt=[] check=ans for i in range(1,x+1): tmp=abs(f(i)-f(x-i)) if ans>=tmp: cnt.append(i) ans=tmp check=min(check,tmp) for i in cnt: if abs(f(i)-f(x-i))==check: print(i,x-i)