#include<stdio.h>
#include<string.h>
bool is_prime(int n)
{
if(n < 2) return false;
for(int i = 2; i*i <= n; ++i)
if(n % i == 0)
return false;
return true;
}
int prime[100];
int main()
{
int num;
while(scanf("%d", &num) == 1)
{
for(int i = 0; i < 100; ++i)
{
prime[i] = is_prime(i) ? 0 : -1;
}
for(int mul = 2; mul <= num; ++mul)
{
int cur = mul;
for(int div = 2; cur > 1; )
{
//all are prime numbers
if(!(cur % div))
{
++prime[div];
cur /= div;
}
else
{
++div;
}
}
}
printf("%d! = ", num);
int last;
for(last = 99; last >= 0; --last) //last == -1
{
if(prime[last] > 0 )
break;
}
for(int i = 0; i <= last; ++i)
{
if(prime[i] != -1)
printf("%d ", prime[i]);
}
putchar('\n');
}
}