#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
ll fact(ll n){
if(n == 1 || n == 0)
return 1;
return n * fact(n - 1);
}
int main(){
ll t = 1;
while(fact(t) < 1000)
t++;
while(fact(t) <= 10000){
cout << fact(t) << " ";
t++;
}
}