#include "stdio.h"
#include "math.h"
int prime(int n);
int main(void)
{
int i, k, m;
int repeat, ri;
scanf("%d", &repeat);
for(ri = 1; ri <= repeat; ri++){
scanf("%d", &m);
printf("%d = ", m);
/*---------*/
prime(m);
printf("%d\n", m);
}
}
int prime(int n)
{
int i;
printf("1*");
for(i=2;i
if(n%i==0)
{
printf("%d*",i);
n=n/i;
}
else
i++;
}
printf("%d\n",n);
}