#include <iostream>
#include <math.h>
using namespace std;
int main()
{
long int a[256], b, d;
int m, n, i, j, r;
cin >> n;
m = 1;
m = log(n) * n/6 + 2;
//估算结果的位数
memset(a, 0, sizeof(a));
a[1] = 1;
d = 0;
for (i = 2; i <= n; i++)
{// 算法核心
for (j = 1; j <= m+5; j++)
{
b = a[j]*i + d;
a[j] = b%1000000;
d = b/1000000;
}
if (d > 0 ) a[j] = d;
}
for (i = m; i > 0; i--)
if(a[i] == 0)
continue;
else
{
r = i;
break;
}
cout << n << "!=";
cout << a[r] << "
";
for (i = r-1; i >=1; i--)
{
if(a[i] > 99999) cout << a[i] << "
";
else if(a[i] <= 99999 && a[i] > 9999) cout << "0" << a[i] << "
";
else if(a[i] <= 9999 && a[i] > 999)
cout << "00" << a[i] << "
";
else if(a[i] <= 999 && a[i] > 99)
cout << "000" << a[i] << "
";
else if(a[i] <= 99 && a[i] > 9)
cout << "0000" << a[i] << "
";
else
cout << "00000" << a[i] << "
";
}
cout << endl;
return 0;
}