#include <iostream>
using namespace std;
void add(char *large,char *small,const int llenght,const int slenght)
{
char *answer = large;
char *pLarge = &large[llenght];
char *pSmall = &small[slenght];
int count = llenght;
while(pSmall != small)
{
answer[count] = *pLarge + *pSmall;
pLarge--;
pSmall--;
count--;
}
answer[count] =*pLarge + *pSmall;
for(count = llenght;count > 0;count--)
{
if(answer[count] > 9)
{
answer[count] -= 10;
answer[count-1] += 1;
}
}
count = 0;
while(count < llenght)
cout<<(int)answer[count++];
}
int main()
{
int times;
cin>>times;
char numA[1002];
char numB[1002];
for(int i = 1;i <= times;i++)
{
cin>>numA;
cin>>numB;
cout<<"Case "<<i<<':'<<endl;
cout<<numA<<' '<<'+'<<' '<<numB<<' '<<'='<<' ';
int alenght = strlen(numA);
int blenght = strlen(numB);
int count = 0;
for(;count < alenght;count++)
numA[count] -= 48;
count = 0;
for(;count < blenght;count++)
numB[count] -= 48;
if(alenght > blenght)
add(numA,numB,alenght,blenght);
else
add(numB,numA,blenght,alenght);
cout<<endl;
if(i != times)
cout<<endl;
}
return 0;
}