X = int(input()) score = [i for i in range(X+1)] for i in range(1,X+1): for j in range(i,X+1,i): score[j] -= 1 cand = 10**10 for i in range(1,X): cand = min(cand,abs(score[i]-score[X-i])) for a in range(1,X): b = X-a if abs(score[a]-score[b]) == cand: print(a,b)