#include <bits/stdc++.h>
using namespace std;
long long n;
bool first = true;
int main() {
cin >> n;
long long temp = n;
for(int i = 2; i * i <= n; i++) {
if(!(temp % i)) {
int index = 0;
while(!(temp % i)) {
temp /= i;
index++;
}
if(!first)
cout << "* ";
if(index > 1)
cout << i << '^' << index << ' ';
else
cout << i << ' ';
first = false;
}
}
if(temp > 1) {
if(temp == n)
cout << temp;
else
cout << "* " << temp;
}
return 0;
}