#include<iostream>
#include<cmath>
using namespace std;
int main() {
int a, b,c ;
cin >> a;
b = 2;
c = 0;
while (a > 1) {
while (a % b == 0) {
a = a / b;
c = c + 1;
}
if (c != 0) {
if(c==1)
{
cout << b ;
}
else {
cout << b << "^" << c;
}
if (a != 1) {
cout << " " << "*" << " ";
}
}
b = b + 1;
c = 0;
}
return 0;
}