Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/while-tub-kopaytuvchilarga-ajratish

Prime factorization

Medium 1000 ms 64 MB 50%
Share

A positive integer $n$ is given ($n \ge 2$). Factor it into primes: print the factors in increasing order, including repeated ones (for example, $360 = 2 * 2 * 2 * 3 * 3 * 5$).

Repeatedly dividing the number by its prime factors

Input

One positive integer $n$.

Output

One line with the prime factors in increasing order separated by spaces.

Note

$2 \le n \le 10^{12}$

Examples

Input #1
360
Output #1
2 2 2 3 3 5
Input #2
97
Output #2
97

Sign in to submit a solution

Signing up is free and takes a minute.