import numpy as np N = int(input()) l = np.zeros(N+1) num = 10**9 for i in range(1,N+1): l[::i] += 1 for j in range(1,N): num = min(num,abs((j-l[j])-(N-j-l[N-j]))) num = int(num) for k in range(1,N): if abs((k-l[k])-(N-k-l[N-k])) == num: print(k,N-k)