X = int(input()) ans = set() def make_divisors(n): divisors = [] for i in range(1, int(n**0.5) + 1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n // i) divisors.sort() return divisors def calc_cost(a, b): return abs((a-len(make_divisors(a)))-(b-len(make_divisors(b)))) min_cost = 10**9 for A in range(1, X//2+1+int(X%2!=0)): cost = calc_cost(A, X-A) if cost < min_cost: min_cost = cost ans = set() if cost == min_cost: ans.add((A, X-A)) ans.add((X-A, A)) for num in sorted(list(ans)): print(*num)