#include <iostream>
using namespace std;
int main(void) {
int num;
while(cin >> num) {
int divisor = 2, count;
bool status = true;
while(num != 1) {
count = 0;
while(num % divisor == 0) {
num /= divisor;
count++;
}
if(count > 0 && status == true) {
if(count > 1)
cout << divisor << '^' << count;
if(count == 1)
cout << divisor;
status = false;
} else if(count > 0) {
if(count > 1)
cout << " * " << divisor << '^' << count;
if(count == 1)
cout << " * " << divisor;
}
divisor++;
}
cout << endl;
}
}