#CCBOTPBA0000059. In thừa số kèm số mũ (Prime Factors with Exponents)

In thừa số kèm số mũ (Prime Factors with Exponents)

Prime Factors with Exponents

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

Given an integer n≥2n\ge2, express it as a product of powers of primes. For each prime factor pp, let ee be the multiplicity of pp in the factorization (the largest exponent such that pep^e divides nn). Print each pair p,ep,e on its own line, with prime factors in strictly increasing order. Print each distinct prime exactly once.

Input

One line contains one integer nn.

Output

Print two integers pp and ee separated by one space on each line, in increasing order of pp.

Subtasks

  • Subtask 1 (20%): 2≤n≤1042\le n\le10^4.
  • Subtask 2 (30%): 2≤n≤1082\le n\le10^8.
  • Subtask 3 (50%): 2≤n≤10122\le n\le10^{12}.

Examples

Example 1

Input:

360

Output:

2 3
3 2
5 1

Explanation: Since 360=23⋅32⋅5360=2^3\cdot3^2\cdot5, print prime-exponent pairs (2,3), (3,2), (5,1) in increasing prime order.

Example 2

Input:

13

Output:

13 1

Explanation: 13 is prime, so its factorization contains just the pair 13 1.

Example 3

Input:

64

Output:

2 6

Explanation: Dividing 64 by 2 six times reaches 1, hence 64=2664=2^6 and the only line is 2 6.