# include # define int long long # define FILE(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout); using namespace std; const int mod = 1e12; int n; int ans = 1; signed main() { //FILE("factorial"); cin >> n; if (n >= 50) { for (int i = 1; i <= 12; i ++) { cout << 0; } return 0; } for (int i = 1; i <= n; i ++) { ans = ans * i % mod; } string s = to_string(ans); while (s.size() < 12) { s = "0" + s; } if (n >= 15) cout << s; else cout << ans; return 0; }