#include using namespace std; typedef long long ll; template string toString(const T& x) { ostringstream os; os << x; return os.str(); } int main(void) { ll n; cin >> n; ll fact = (n >= 50 ? 0 : 1); for (int i = 1; i <= min(50LL, n); i++) { fact *= i; fact %= (ll)1e12; } string ans = toString(fact); while (ans.size() < 12) ans = '0' + ans; cout << ans << endl; return 0; }