#include <iostream>
using namespace std;
int main() {
int a;
while (cin >> a) {
if (a!=0){
int i = a;
int t = a;
if (a == 1) {
cout << a << "! = ";
} else if (a > 1) {
cout << a << "! = " << a << " * ";
}
while (i-- && i > 1) {
cout << i << " * ";
}
if (t != 0) {
cout << 1 << " = ";
}
for (int q = 1; q < a; q++) {
t = t * q;
}
cout << t << endl;
}
else {
cout << "0! = 1 = 1" << endl;
}
}
}