#include #define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define MOD 1000000007 #define int long long using namespace std; typedef long long ll; typedef vector> mat; const int INF = 1e9; signed main() { ll N; cin >> N; if (N > 100) { cout << "000000000000" << endl; return 0; } ll ans = 1LL; bool over = false; for (ll i=2; i<=N; i++) { ans *= i; if (ans >= 1000000000000LL) { ans %= 1000000000000LL; over = true; } } if (over) { printf("%012lld\n", ans); } else { cout << ans << endl; } }