import java.util.Scanner;
public class test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int i, t = 2,re=0; i = sc.nextInt();
while (i != 1){
int count = 0;
while (i % t == 0) {
count++;
i =i / t;
}
if (count > 0) {
if (re==0) {
System.out.print(t);
if(count==1) System.out.print("");
else System.out.print("^"+count);
re++;
} else {
System.out.print(" * "+t);
if(count==1) System.out.print("");
else System.out.print("^"+count);
}
}
t++;
}
System.out.println();
}
}
}