import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) from collections import Counter class Prime_Decomposition: def __init__(self, n_max): self.min_factor = min_factor = list(range(n_max + 1)) for i in range(2, int(n_max ** 0.5) + 1): if min_factor[i] == i: for j in range(i * i, n_max + 1, i): if min_factor[j] == j: min_factor[j] = i def __call__(self, n): min_factor = self.min_factor n_twoes = (n & -n).bit_length() - 1 # 最悪ケースでは速くなる res = [2] * n_twoes n >>= n_twoes while n > 1: p = min_factor[n] res.append(p) n //= p return res n = int(readline()) prime_check = Prime_Decomposition(n + 1) a = 1 b = 1 for k, v in Counter(prime_check(n)).items(): x, y = divmod(v, 2) if x != 0: a *= k ** x if y != 0: b *= k print(a, b)