package a010;
import java.util.Scanner;
public class JAVA
{
public static void main(String[] args)
{
//建立質數表
///////////////////////////////////////////
//預設為false=質數
boolean []list = new boolean[1000002];
for(int i=2;i<=1000000;i++)
{
if(!list[i])
{
for(int j=i+i;j<=1000000;j=j+j)
{
list[j]=true;
}
}
}
///////////////////////////////////////////
Scanner s = new Scanner(System.in);
while(s.hasNext())
{
int cin=s.nextInt();
int []check = new int[1000002];
String cout="";
n:
for(int i=2;i<=1000000;i++)
{
if(cin==1)
break n;
if(cin % i==0)
{
check[i]+=1;
cin=cin/i;
i=1;
}
}
for(int i=2;i<=1000000;i++)
{
if(check[i]==0)
{
continue;
}
else
{
if(check[i]==1)
{
cout=cout+i+" * ";
}
else
{
cout=cout+i+"^"+check[i]+" * ";
}
}
}
System.out.println(cout.substring(0,cout.length()-3));
}
}
}