#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
char a[1005];
char b[1005];
using namespace std;
int main()
{
int n;
scanf("%d",&n);
for (int i=1;i<=n;i++)
{
char c[1010];
int num=0;
for (int j=0;j<1005;j++)
c[j]=a[j]=b[j]='0';
scanf("%s %s",a,b);
int ba=0,bb=0;
int lena=strlen(a),lenb=strlen(b);
while (a[ba]=='0')
{
ba++;
}
while (b[bb]=='0')
{
bb++;
}
//printf("%d %d\n",ba,bb);
int jin=0;
int temp;
while (lena>ba&&lenb>bb)
{
temp=a[--lena]-'0'+b[--lenb]-'0'+jin;
jin=temp/10;
c[num++]=(temp%10)+'0';
}
while (lena>ba)
{
temp=a[--lena]-'0'+jin;
jin=temp/10;
c[num++]=(temp%10)+'0';
}
while (lenb>bb)
{
temp=b[--lenb]-'0'+jin;
jin=temp/10;
c[num++]=(temp%10)+'0';
}
printf("Case %d:\n",i);
printf("%s + %s = ",a,b);
if(num==0)
printf("0\n");
else{
if(jin)
printf("%c",jin+'0');
//printf("%d\n",num);
for (int k=num-1;k>=0;k--)
{
printf("%c",c[k]);
}
printf("\n");
}
if(i<n)
printf("\n");
}
return 0;
}