import java.util.Scanner;
public class Java{
public static void main(String[] args){
Scanner scn = new Scanner(System.in);
while(scn.hasNext()){
int s = scn.nextInt();
int x=0;
int[] t={};
for(int i=2;i<1000000;i++){
int z=0;
for(;s%i==0;){
int e=i;
s=s/e;
t[z] = e;
z=z+1;
}
}
for (int d=1;d < t.length; d++){
System.out.print(t[0]);
if(t[d]==t[d-1]){
System.out.print("^");
System.out.print(t[d]);
}else{
System.out.print("*");
System.out.print(t[d]);
}
}
System.out.print("\n");
}
}
}