#include <stdio.h>
int main(void)
{
int num,q = 2,n;
scanf("%d",&num);
while(num >= q)
{
if(num % q == 0)
{
n = 0;
while(num % q == 0)
{
num = num / q;
n++;
}
if(n == 1) printf("%d",q);
else printf("%d^%d",q,n);
if(num != 1)printf(" * ");
}
q++;
}
}