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