#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main(){
int i, n1, n2;
cin >> i;
char op;
for(int x = 0; x <= i; ++x) {
string s;
getline(cin, s);
if(s.size() != 0) {
char tmp = s.front();
if(tmp == 'a' || tmp == 'b' || tmp == 'c') {
op = tmp;
s = s.substr(2);
}
sscanf(s.data(), "%d%d", &n1, &n2);
string ops;
int result;
switch(op) {
case 'a' :
ops = "+";
result = n1 + n2;
break;
case 'b' :
ops = "-";
result = n1 - n2;
break;
case 'c' :
ops = "*";
result = n1 * n2;
break;
}
string xx = to_string(n1) + ops + to_string(n2) + "=" + to_string(result);
cout << xx << endl;
cout << xx.length() << endl;
}
}
return 0;
}