LearnPy Hub
← Loops problems
Hard

Prime Factorisation

Read n ≥ 2 and print its prime factorisation, smallest prime first, as p^k joined by x (write just p when k is 1). Example: 360 → 2^3 x 3^2 x 5.

Input

One integer up to 10¹².

Output

One line.

Sample 1

Input
360
Output
2^3 x 3^2 x 5

Sample 2

Input
2
Output
2
solution.py
Output appears here
Prime Factorisation · Python practice problem · LearnPy Hub