#include <iostream>
#include <vector>
#include <map>
using namespace std;
void primeFactorization(long long n) {
map<long long, long long> primes;
for (int i = 2; i * i <= n; i++) {
while (n % i == 0) {
primes[i]++;
n /= i;
}
}
if (n > 1) {
primes[n]++;
}
for (auto it = primes.begin(); it != primes.end(); ++it) {
cout << it->first;
if (it->second > 1) {
cout << "^" << it->second;
}
if (next(it) != primes.end()) {
cout << " * ";
}
}
cout << endl;
}
int main() {
long long n;
cin >> n;
primeFactorization(n);
return 0;
}