#include #include #include #include using namespace std; #define ll long long const ll MOD = 1e12; int main() { cin.tie(0);ios::sync_with_stdio(false); ll N; cin >> N; if (N >= 50) { cout << "000000000000" << endl; return 0; } ll ans = 1; for (ll i = 1; i <= N; i++) { (ans = ans * i) %= MOD; } if (N >= 20) { ll temp = ans; ll c = 0; while (temp /= 10) { c++; } string str(12 - c - 1, '0'); cout << str << ans << endl; return 0; } cout << ans << endl; }