x = int(input()) Z = x D = [[] for _ in range(Z+1)] for i in range(1, Z+1): for j in range(i, Z+1, i): D[j].append(i) li = [[] for i in range(x+1)] for i in range(1,x): fa = i-len(D[i]) fb = (x-i)-len(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()