#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); ll N; cin >> N; ll mod = 1000000000000; ll ans = 1; int f = 0; for(ll i = 1; i <= N; i++) { ans *= i; if(ans >= mod) f = 1; ans %= mod; if(ans == 0) { cout << string(12, '0') << endl; return 0; } } if(f) { printf("%012lld\n", ans); } else { printf("%lld\n", ans); } }