#include <iostream>
using namespace std;
int func(int n){
if (n == 1){
cout << " 1";
return 1;
}else{
cout << " " << n << " *";
return n * func(n-1);
}
}
int main(){
int n, ans;
while (cin >> n){
if (n == 0){
cout << "0! = 1 = 1\n";
}
else{
cout << n << "! =";
ans = func(n);
cout << " = " << ans << "\n";
}
}
}