#include #include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() #define ll long long #define ld long double #define INF 1000000000000000000 typedef pair pll; int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; ll MOD = pow(10, 12); ll sum = 1, exp = 1; if (N >= 65) { cout << "000000000000" << endl; return 0; } else { ll sum = 1; for (int i = N; i > 0; i--) { sum *= i; sum %= MOD; if (sum == 0) { cout << "000000000000" << endl; return 0; } } string s = to_string(sum); if (N >= 16) { int cnt = max(0, 12 - (int)s.size()); rep(i, cnt) { s = '0' + s; } } cout << s << endl; return 0; } }