x = int(input()) f = [i for i in range(x)] for i in range(1,x): for j in range(i,x,i): f[j] -= 1 ans = 10**18 for i in range(1,x): if ans > abs(f[i] - f[x-i]): ans = abs(f[i] - f[x-i]) for i in range(1,x): if ans == abs(f[i] - f[x-i]): print(i, x - i)