#include <iostream> using namespace std; int main() { int n; while (cin >> n) { int a[1000] = {1},len = 0; for (int i = 2; i <= n; ++i) { int carry = 0,iTemp; for (int j = 0; j <= len; ++j) { iTemp = a[j] * i + carry; carry = iTemp / 1000000; a[j] = iTemp % 1000000; } if (carry) a[len+1] = carry,len++; } cout << n << "!" << endl; cout << a[len]; for (int i = len-1; i >= 0; --i) printf("%06d",a[i]); cout << endl; } return 0; }