#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); unsigned long long n, ans = 1, mod = 1e12; cin >> n; for(int i = 1; i <= n; i++) { ans *= i; ans %= mod; if(i == 50){ cout << "000000000000" << endl; return 0; } } printf(n >= 15 ? "%012lld\n": "%lld\n", ans); return 0; }