#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int main() {
long long a[50000][2]={0};
long long word ;
int count=0, stay=0, start=2 ;
scanf("%lli",&word) ;
while(word!=1){
while(word%start==0){
word=word/start ;
count++ ;
}
if(count!=0){
a[stay][0]=start ;
a[stay][1]=count ;
stay++ ;
}
count=0 ;
start++ ;
}
long long running=0 ;
while((a[running][0]!=0)||(a[0][0]==0)){
if((a[running][1]!=1)&&(a[running][1]!=0)){
printf("%lli^%lli ",a[running][0],a[running][1]) ;
}else if(a[running][1]==1){
printf("%lli ",a[running][0]) ;
}else if(a[0][0]==0){
printf("%lli ",a[running][0]) ;
}
if(a[running+1][0]!=0){
printf("* ") ;
}
running++ ;
}
return 0;
}