#include<iostream> #include<vector> #include<algorithm> using namespace std; vector<int> mul(vector<int> A, int b) { int t = 0; int len = A.size(); vector<int>ans; for(int i = 0;i < len || t;i++) { if(i < len) t += A[i] * b; ans.push_back(t % 10); t /= 10; } return ans; } void print(vector<int> v) { for(int i = 0;i < v.size();i++) { cout << v[i] ; } puts(""); } int main(void) { int N; while(cin >> N) { vector<int>v; v.push_back(1); for(int i = 2;i <= N;i++) { v = mul(v,i); } reverse(v.begin(),v.end()); print(v); } return 0; }