def prime(n,p): iteral = 0 while n%p == 0: n //= p iteral += 1 return iteral from collections import deque def makeprime(N): if N == 2: ans = set([2]) return ans else: ans = deque([2*i+1 for i in range(1,N//2+1) if 2*i+1 <= N]+[2]) while ans[0] != max(ans): v = ans.popleft() tmp = set([v*i for i in range(1,len(ans)//v+1) if i*v <= len(ans)]) ans = deque(set(ans)-tmp) return ans def main(): X = int(input()) lis = makeprime(X//2+1) ans = [] val = 2**60 for i in range(1,X//2+1): s1 = 1 s2 = 1 for v in lis: if v <= i: s1 *= (prime(i,v)+1) if v <= X-i: s2 *= (prime(X-i,v)+1) tmp = abs(s1-s2) if tmp < val: val = tmp ans = [] ans.append((i,X-i)) elif tmp == val: ans.append((i,X-i)) while ans: x = ans.pop(0) print(x[0],x[1]) if __name__ == '__main__': main()