prime
bool is_prime[101];
int prime[101];
int ans[101];
int main(int argc, char const* argv[])
{
int m = 0;
for(int i = 2;i <= 100;i++) {
if(!is_prime[i]){
prime[m++] = i;
for(int j = i*i;j <= 100;j = j+i){
is_prime[j] = true;
}
}
}
int n;
while(scanf("%d",&n) && n){
int max_j = 0;
for(int i = 2;i <= n;i++){
int tmp = i;
for(int j = 0; prime[j]*prime[j]<= tmp && j<m;j++ ){
if(tmp%prime[j] == 0){
if(prime[j]>max_j){
max_j = prime[j];
}
int count = 0;
while(tmp%prime[j] == 0){
tmp = tmp/prime[j];
count++;
}
ans[prime[j]] = ans[prime[j]]+count;
}
}
if(tmp>1){
if(tmp>max_j){
max_j = tmp;
}
ans[tmp] = ans[tmp]+1;
}
}
printf("%3d! =",n);
int count = 0;
for(int i = 2;i<= n;i++){
if(!is_prime[i] && ans[i]){
printf("%3d",ans[i]);
ans[i] = 0;
count++;
if(count%15 == 0 && max_j>i) {
printf("\n ");
}
}
}
printf("\n");
}
return 0;
}