#include<iostream>
using namespace std;
long long factorial(int n){
int fact;
if(n==0||n==1)
fact=1;
else
fact=n*factorial(n-1);
return fact;
}
int main(){
int p;
cout<<"Please enter an integer number(q to quit) :";
while(cin>>p){
long long fac=factorial(p);
cout<<p<<"!="<<fac<<endl;
cout<<"Please enter an integer number(q to quit) :";
}
return 0;
}