#include <bits/stdc++.h>
using namespace std;
long long n,dem,i;
int main()
{
freopen("bl1.inp","r",stdin);
freopen("bl1.out","w",stdout);
cin >> n;
for( i = 2; i <= n; i++)
{
dem = 0;
while(n % i == 0)
{
++dem;
n=n/i;
}
if(dem)
{
cout<<i;
if (dem>1) cout <<"^"<<dem;
if (n>i){
cout <<" * ";
}
}
}
return 0;
}