#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); auto A = [&](int pos) -> string { string ret = "A["; ret += to_string(pos+1); ret += "]"; return ret; }; auto C = [&](int c) -> string { if(c >= 1) return A(c-1); else return string(1,-c+'a'); }; auto f = [&](string s,int a,int b,int c) -> string { string ret = s; ret += " "+C(a); ret += " "+C(b); ret += " "+C(c); return ret; }; int N; cin >> N; bool div = false; vector ope; for(int i=0; i> c >> a; if(c == '+'){ if(div) ope.push_back(f("mul",-1,i+1,-2)),ope.push_back(f("add",-0,-0,-1)); else ope.push_back(f("add",0,i+1,0)); } else if(c == '*') ope.push_back(f("mul",0,0,i+1)); else{ if(div) ope.push_back(f("mul",-2,-2,i+1)); else ope.push_back(f("add",-2,-2,i+1)); div = true; } } if(div) ope.push_back(f("div",0,0,-2)); cout << ope.size() << "\n"; for(auto &s : ope) cout << s << "\n"; }