import java.util.Scanner;
public class a {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
int num,i=2;
num = sc.nextInt();
boolean b = true;
do{
int a=0;
while(num%i==0){
a++;
num/=i;
}
if(a>0){
if (b){
System.out.print( i + (a==1?"":("^"+a)) );
b=false;
}
else {
System.out.print( " * " + i + (a==1?"":("^"+a)) );
}
}
i++;
}while(num!=1);
System.out.println();
}
}
}