#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
long long res = 1;
for(int i = 1; i <= n; i++){
res *= i;
cout << res << endl;
while(res % 10 == 0) res /= 10;
res %=10;
cout << res << endl;
}
cout << res << endl;
return 0;
}