#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; typedef long double ld; typedef std::pair pii; typedef std::pair pll; typedef std::pair pid; typedef std::pair pls; typedef std::vector vb; typedef std::vector vvb; typedef std::vector vi; typedef std::vector vvi; typedef std::vector vvvi; typedef std::vector vvvvi; typedef std::vector vl; typedef std::vector vvl; typedef std::vector vvvl; typedef std::vector vvvvl; typedef std::vector vd; typedef std::vector vvd; typedef std::vector vs; #define rep(i,n) for(auto i=0; i=0; --i) #define repdm(i,e,n) for(auto i=n-1; i>=e; --i) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() template inline bool chmax(T& a, T b, int eq = 0) { if (a < b || (a == b && eq)) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b, int eq = 0) { if (a > b || (a == b && eq)) { a = b; return 1; } return 0; } template * = nullptr> constexpr istream& operator>>(istream& is, mint& x) noexcept {long long v = 0; std::cin >> v; x = v; return is;} template * = nullptr> constexpr ostream& operator<<(ostream& os, const mint& x) noexcept {os << x.val(); return os;} inline void _n() { std::cout << std::endl; } template inline void _(const T a) { std::cout << a; } template inline void _l(const T a) { _(a); _n(); } template inline void _s(const T a) { _(a); _(' '); } template inline void _v(const std::vector v) { for(auto a : v) _(a); } template inline void _vl(const std::vector v) { for(auto a : v) _l(a); } template inline void _vs(const std::vector v) { for(auto a : v) _s(a); _n(); } template inline void _vvl(const std::vector> v) { for(auto a : v) { _v(a); _n(); } } template inline void _vvs(const std::vector> v) { for(auto a : v) { _vs(a); } } inline void ynl(const bool b) {_l(b ? "yes" : "no");} inline void yns(const bool b) {_l(b ? "Yes" : "No");} inline void ynu(const bool b) {_l(b ? "YES" : "NO");} constexpr int INF = numeric_limits::max() >> 1; constexpr long long INF_LL = numeric_limits::max() >> 1LL; const long long MOD1 = 1000000007; const long long MOD9 = 998244353; using mint1 = atcoder::modint1000000007; using mint9 = atcoder::modint998244353; //* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *// void input() { } template struct graph_l { public : graph_l(int n) : _n(n), _graph(n), _dist(n, 0) {} void add (int from, int to, Cost cost){ assert(0 <= from && from < _n); assert(0 <= to && to < _n); _graph[from].push_back(_edge{(unsigned int)from, (unsigned int)to, cost}); } void add_bi (int from, int to, Cost cost){ add(from, to, cost); add(to, from, cost); } bool isReachable (int v) { assert(0 <= v && v < _n); return _dist[v] < DIST_INF; } Cost get_dist (int v) { assert(0 <= v && v < _n); return _dist[v]; } std::vector get_edges(int v) { std::vector edges; for (auto edge : _graph[v]) { edges.push_back(edge.to); } return edges; } void dijkstra (int s) { assert(0 <= s && s < _n); for (int i = 0 ; i < _n ; ++i) { _dist[i] = DIST_INF; } _dist[s] = 0; auto edge_compare = [] (_edge e1, _edge e2) { if (e1.cost != e2.cost) return e1.cost > e2.cost; else if (e1.to != e2.to) return e1.to > e2.to; else return e1.from > e2.from; }; priority_queue<_edge, vector<_edge>, function> edge_que(edge_compare); for (auto e : _graph[s]) { edge_que.push(_edge{e.from, e.to, e.cost}); if(_dist[e.to] > e.cost) _dist[e.to] = e.cost; } while (!edge_que.empty()) { _edge p = edge_que.top(); edge_que.pop(); unsigned int v = p.to; if (_dist[v] < p.cost) continue; for (auto e : _graph[v]) { auto next_cost = e.cost + _dist[v]; if (_dist[e.to] <= next_cost) continue; _dist[e.to] = next_cost; edge_que.push(_edge{e.from, e.to, _dist[e.to]}); } } } private: int _n; const Cost DIST_INF = numeric_limits::max(); struct _edge { unsigned int from; unsigned int to; Cost cost; }; std::vector> _graph; std::vector _dist; }; void solve() { ll N; cin >> N; int flg = 0; ll tmp = 1; for(int i = 2; i <= N; ++i) { tmp *= i; if(tmp >= 1000000000000) flg = 1; if(tmp == 0) break; tmp %= 1000000000000; } if(tmp != 0) { if(flg) rep(i, 11 - floor(log10(tmp))) _(0); _l(tmp); } else { _l("000000000000"); } } //* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *// int main() { std::ifstream in("input.txt"); std::cin.rdbuf(in.rdbuf()); std::cin.tie(0); std::ios::sync_with_stdio(false); input(); solve(); return 0; }