from itertools import count def calc_positive_divisors(num: int) -> dict[int, int]: if num < 2: raise ValueError divisors = {} for divisor in count(2): if divisor ** 2 > num: if num != 1: divisors[num] = 1 break while num % divisor == 0 and num != 1: try: divisors[divisor] += 1 except KeyError: divisors[divisor] = 1 num //= divisor return divisors def main(): M = int(input()) if M == 1: print(1, 1) return if M == 2: print(1, 2) return divisors = calc_positive_divisors(M) if len(divisors) == 1 and divisors[list(divisors.keys())[0]] == 1: print(1, M) else: divisor = list(divisors.keys())[0] divisors[divisor] -= 1 if divisors[divisor] == 0: divisors.pop(divisor) another_divisor = 1 for divisor_, count_ in divisors.items(): another_divisor *= divisor_ ** count_ print(divisor, another_divisor) if __name__ == "__main__": main()