public class a010 {
public static void main(String [] args) {
java.util.Scanner sc=new java.util.Scanner(System.in);
int a=0;
String ans="";
while(sc.hasNext()) {
a=sc.nextInt();
ans="";
int first=0;
while(a>=Math.sqrt(a)) {
int b=2;
int count=1;
while(a%b==0) {
String ele=String.valueOf(b);
if(first==0) {
ans+=ele;
}else if(count>1) {
ans=ans+"^"+ele;
}else {
ans=ans+" * "+ele;
}
first++;
count++;
}
b++;
}
System.out.println(ans);
}
}
}