import java.util.Scanner;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for (int i = 2; i <= n; i++) {
int count = 0;
while (n % i == 0) {
n /= i;
count++;
}
if (count > 0) {
if (count == 1) {
System.out.print(i);
} else {
System.out.print(i + "^" + count);
}
if (n > 1) {
System.out.print(" * ");
}
}
}
}
}
import java.util.Scanner;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
for (int i = 2; i <= n; i++) {
int count = 0;
while (n % i == 0) {
n /= i;
count++;
}
if (count > 0) {
if (count == 1) {
System.out.print(i);
} else {
System.out.print(i + "^" + count);
}
if (n > 1) {
System.out.print(" * ");
}
}
}
}
}