#include <iostream>
using namespace std;
#include <cmath>
const int maxn = 1000010;
struct factor{
int m = 0,cnt = 0;
};
factor p[maxn];
int main()
{
int k = 2;
int x;
int e = 1;
cin >> x;
int t = x;
if(x == 1){
cout << x << "=" << 1;
return 0;
}
while(x > 1){
if (x % k == 0){
x = x / k;
p[k].m = k;
p[k].cnt++;
}
else k++;
}
cout << t << "=";
for(int i = 0; i < maxn; i++){
if(p[i].cnt != 0){
e =pow(p[i].m, p[i].cnt) * e;
if(e < t){
if(p[i].cnt > 1) cout << p[i].m << "^" << p[i].cnt << "*";
else if(p[i].cnt == 1) cout << p[i].m << "*";
}
else {
if(p[i].cnt > 1) cout << p[i].m << "^" << p[i].cnt;
else if(p[i].cnt == 1) cout << p[i].m;
}
}
}
return 0;
}