#include<bits/stdc++.h>
#define LL long long
using namespace std;
LL a,cnt,n,i,j,t;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n;
t=n;
i=2;
do
{
while(n%i==0)
{
cnt++;
n/=i;
}
if(cnt)
{
if(a==0) cout<<i,a++;
else cout<<" * "<<i,a++;
if(cnt>1) cout<<"^"<<cnt;
}
cnt=0;
i++;
}while(n!=1);
return 0;
}