#include <iostream>
using namespace std;
int main() {
int a1;
cin>>a1;
int a2=a1;
for (int b=2;a2>1;b++){
int sum=0;
while (a2%b==0){
sum++;
a2/=b;
}
if(sum == 1){
cout<<b;
if (a2>1){
cout<<" * ";
}
}
else if(sum>1){
cout<<b<<"^"<<sum;
if(a2>1){
cout<<" * ";
}
}
}
return 0;
}