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

#GL0000195. Phân tích thành dãy chia hết (Number into Sequence)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Phân tích thành dãy chia hết (Number into Sequence)

Phân tích thành dãy chia hết (Number into Sequence)

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given n>1n>1, construct a1,…,aka_1,\ldots,a_k of integers greater than 11 with product nn and ai∣ai+1a_i\mid a_{i+1} for all adjacent indices. Maximize the length kk; any optimal sequence is accepted.

Input

One integer nn.

Output

Print the optimal length kk, then the sequence of kk values.

Subtasks

  • Subtask 1 (20 points): 2≤n≤100002\le n\le 10000.

  • Subtask 2 (30 points): 2≤n≤1000000002\le n\le 100000000.

  • Subtask 3 (50 points): 2≤n≤100000000002\le n\le 10000000000.

Examples

Example 1

Input

360

Output

3
2 2 90

Explanation

The product is 2⋅2⋅90=3602\cdot2\cdot90=360 and the divisibility chain is valid. The maximum prime exponent of 360=23⋅32⋅5360=2^3\cdot3^2\cdot5 is three, proving optimality.

Example 2

Input

2

Output

1
2

Explanation

Since 22 is prime, the only possible sequence has one element.

Example 3

Input

36

Output

2
2 18

Explanation

The sequence [2,18][2,18] has product 3636 and respects 2∣182\mid18; the maximum prime exponent in 3636 is two.