#include<bits/stdc++.h>
using namespace std;
int main(){
int num;
cin>>num;
while(num!=1){
for(int i=2;i<=num;i++){
if(num%i==0){
num/=i;
int down=1;
while(num%i==0){
down++;
num/=i;
}
if(down==1 and num==1){cout<<i;}
if(down!=1 and num==1){cout<<i<<"^"<<down;}
if(down==1 and num!=1){cout<<i<<" * ";}
if(down!=1 and num!=1){cout<<i<<"^"<<down<<" * ";}
}
}
}
}