#include <stdio.h>
int main()
{
int math ;
while ( scanf ( "%d" , &math ) != EOF){
int i = 0 , t = 0 ;
for ( i = 2 ; i <= math ; i ++ ){
while( !( math % i ) ){
t++ ;
math /= i ;
}
if ( t > 1 ){
if ( math != 1 )
printf ( "%d^%d * " , i , t ) ;
else{
printf ( "%d^%d" , i , t ) ;
break ;
}
}
else if ( t == 1 ){
if ( math != 1 )
printf ( "%d * " , i ) ;
else{
printf ( "%d" , i ) ;
break ;
}
}
t = 0 ;
}
printf ( "\n" ) ;
}
}