include
include
include
using namespace std;
int st(char* s)
{
int x=0;
int i=1;
int j=0;
while(s[j])
{
x*=10;
x+=(s[j]-'0');
j++;
}
return x;
}
int main()
{
int t;
cin>>t;
cout<<t<<endl;
while(t>0)
{
char a[1000],x[1],b[1000],y[1],c[1000];
int p,q;
cin>>a;
cin>>x;
cin>>b;
cin>>y;
cin>>c;
cout<<endl;
cout<<t<<endl;
if(strstr(a,"machula"))
{
p=st(b);
q=st(c);
cout<<q-p<<" + "<<p<<" = "<<q<<endl;
}
else if(strstr(b,"machula"))
{
p=st(a);
q=st(c);
cout<<a<<" + "<<q-p<<" = "<<c<<endl;
}
else
cout<<a<<" + "<<b<<" = "<<st(a)+st(b)<<endl;
cout<<t<<endl;
t=t-1;
cout<<t<<endl;
}
return 0;
}