#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef pair P; typedef pair PL; ll m = 1e12; int main() { ll n; cin >> n; if (n > 100){ cout << "000000000000" << endl; return 0; } ll ans = 1; FOR(i,1,n){ ans = (ans * i) % m; } if (ans < m){ cout << ans << endl; return 0; } printf("%012lld", ans); return 0; }