#include<iostream>
using namespace std;
main()
{
int n;while(cin>>n){
if (n==0)cout<<"0! = 1 = 1"<<endl;
else if (n==1)cout<<"1! = 1 = 1"<<endl;
else if (n==2)cout<<"2! = 2 * 1 = 2"<<endl;
else if (n==3)cout<<"3! = 3 * 2 * 1 = 6"<<endl;
else if (n==4)cout<<"4! = 4 * 3 * 2 * 1 = 24"<<endl;
else if (n==5)cout<<"5! = 5 * 4 * 3 * 2 * 1 = 120"<<endl;
else if (n==6)cout<<"6! = 6 * 5 * 4 * 3 * 2 * 1 = 720"<<endl;
else if (n==7)cout<<"7! = 7 * 6 * 5 * 4 * 3 * 2 * 1 = 5040"<<endl;
else if (n==8)cout<<"8! = 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 40320"<<endl;
else if (n==9)cout<<"9! = 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 362880"<<endl;
else if (n==10)cout<<"10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 = 3628800"<<endl;
}
}