#include <iostream>
using namespace std;
int main (){
int input,b=2,i=0;//i為次方,b為除數,
cin >> input ;
while(input != 1)
{
while (input %b==0){
input /=b;
i++;
}
if(input == 1){
if(i==1)
cout << b;
else
cout << b<< "^" << i;
}
else if(i>=2)
cout << b<< "^" << i <<" * ";
else if(i==1)
cout << b <<" * ";
i=0;
b++;
}
}