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