#include <bits/stdc++.h>using namespace std;long long z=1;long long a,sn;int main(){cin >> sn;for(a=2 ; a<=sn ; a++) {if( sn%a == 0 ){cout << a;sn /= a;while( sn%a == 0 ){sn /= a;z+=1;}if(z!=1){cout << "^" << z;z = 1;}if(a!=a*sn){cout << " " <<"*" << " ";}}}}