PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000270. Phân tích N thành bình phương nguyên tố (Happy New Year 2023)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Phân tích N thành bình phương nguyên tố (Happy New Year 2023)

Happy New Year 2023

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

You are given a positive integer NN. It is guaranteed that there are two distinct primes pp and qq such that N=p2qN=p^2q.

Find pp and qq. The required pair is unique under the problem guarantee.

Input

One line contains the positive integer NN.

Output

Print the two primes pp and qq, separated by one space, in the correct order for N=p2qN=p^2q.

Subtasks

  • Subtask 1 (20 points): 1≤N≤1081\le N\le10^8; there exist distinct primes p,qp,q with N=p2qN=p^2q.
  • Subtask 2 (30 points): 1≤N≤10121\le N\le10^{12}; there exist distinct primes p,qp,q with N=p2qN=p^2q.
  • Subtask 3 (50 points): 1≤N≤9⋅10181\le N\le9\cdot10^{18}; there exist distinct primes p,qp,q with N=p2qN=p^2q.

Examples

Example 1

Input

2023

Output

17 7

Explanation

172⋅7=289⋅7=202317^2\cdot7=289\cdot7=2023. Both factors are distinct primes; the squared factor must be printed first, giving 17 7.

Example 2

Input

63

Output

3 7

Explanation

6363 is divisible by both 33 and 99. Dividing by 99 leaves 77, so 63=32⋅763=3^2\cdot7 with distinct primes; therefore print 3 7.

Example 3

Input

1059872604593911

Output

104149 97711

Explanation

1041492⋅97711=1059872604593911104149^2\cdot97711=1059872604593911. These are distinct primes; print the squared base first as 104149 97711.