from collections import Counter def factorization(n): if n == 1: return [1] res = [] x = n y = 2 while y * y <= x: while x % y == 0: res.append(y) x //= y y += 1 if x > 1: res.append(x) return res def val(n): if n == 1: return 0 f = factorization(n) C = Counter(f) tmp = 1 for v in C.values(): tmp *= v + 1 return n - tmp X = int(input()) ans = [] minf = 10**18 for i in range(1, X): if abs(i - (X - i)) > 10000: continue dif = abs(val(i) - val(X - i)) if dif == minf: ans.append((i, X - i)) elif dif < minf: ans = [(i, X - i)] minf = dif else: pass for a in ans: print(*a)