x = int(input()) Z = x D = [0 for _ in range(Z+1)] for i in range(1, Z+1): for j in range(i, Z+1, i): D[j] += 1 li = [[] for i in range(x+1)] for i in range(1,x): fa = i-D[i] fb = (x-i)-D[x-i] li[abs(fa-fb)].append([i,x-i]) for i in range(x+1): if len(li[i]) > 0: for j in range(len(li[i])): print(*li[i][j]) exit()