#include <iostream>
using namespace std;
char* ADD(char* str1,char* str2)
{
int n1,n2,n;
char *res;
int c = 0;
n1 = strlen(str1);
n2 = strlen(str2);
n = n1 > n2 ? n1 : n2;
res = new char[n + 2];
res[n+1] = '\0';
for(int i = n; i >= 0; i--)
{
res[i] = i > n - n1 ? str1[n1 + i - n - 1] : '0';
}
for(i = n; i >= 0; i--)
{
int temp;
temp = i > n - n2 ? (res[i] - '0') + (str2[n2 + i - n -1] - '0') + c : res[i] - '0' + c;
c = temp > 9 ? 1 : 0;
res[i] = c > 0 ? temp - 10 + '0' : temp + '0';
}
return res;
}
int main()
{
char num1[1001],num2[1001],*res;
int T,i = 1;
cin>>T;
while(i <= T)
{
cin>>num1>>num2;
res = ADD(num1,num2);
if(i < T)
{
cout<<"Case "<<i<<":"<<endl;
if(res[0] == '0')
cout<<num1<<" + "<<num2<<" = "<<res+1<<endl<<endl;
else
cout<<num1<<" + "<<num2<<" = "<<res<<endl<<endl;
}
else
{
cout<<"Case "<<i<<":"<<endl;
if(res[0] == '0')
cout<<num1<<" + "<<num2<<" = "<<res+1<<endl;
else
cout<<num1<<" + "<<num2<<" = "<<res<<endl;
}
i++;
}
return 0;
}
using namespace std;
char* ADD(char* str1,char* str2)
{
int n1,n2,n;
char *res;
int c = 0;
n1 = strlen(str1);
n2 = strlen(str2);
n = n1 > n2 ? n1 : n2;
res = new char[n + 2];
res[n+1] = '\0';
for(int i = n; i >= 0; i--)
{
res[i] = i > n - n1 ? str1[n1 + i - n - 1] : '0';
}
for(i = n; i >= 0; i--)
{
int temp;
temp = i > n - n2 ? (res[i] - '0') + (str2[n2 + i - n -1] - '0') + c : res[i] - '0' + c;
c = temp > 9 ? 1 : 0;
res[i] = c > 0 ? temp - 10 + '0' : temp + '0';
}
return res;
}
int main()
{
char num1[1001],num2[1001],*res;
int T,i = 1;
cin>>T;
while(i <= T)
{
cin>>num1>>num2;
res = ADD(num1,num2);
if(i < T)
{
cout<<"Case "<<i<<":"<<endl;
if(res[0] == '0')
cout<<num1<<" + "<<num2<<" = "<<res+1<<endl<<endl;
else
cout<<num1<<" + "<<num2<<" = "<<res<<endl<<endl;
}
else
{
cout<<"Case "<<i<<":"<<endl;
if(res[0] == '0')
cout<<num1<<" + "<<num2<<" = "<<res+1<<endl;
else
cout<<num1<<" + "<<num2<<" = "<<res<<endl;
}
i++;
}
return 0;
}