#include<stdio.h>
#include<string.h>
int main()
{
int t;
char a[1100],b[1100],beitai[1100];
int c[1100],d[1100],sum[1100];
int i,j,bt,k=1;
int lena,lenb;
scanf("%d",&t);
getchar();
while(t--)
{
scanf("%s %s",a,b);
getchar();
lena=strlen(a);
lenb=strlen(b);
memset(c,0,sizeof(c));
memset(d,0,sizeof(d));
memset(sum,0,sizeof(sum));
for(i=0,j=lena-1;i<lena;i++,j--)
c[j]=a[i]-'0';
for(i=0,j=lenb-1;i<lenb;i++,j--)
d[j]=b[i]-'0';
if(lena<lenb)
{
bt=lena;
lena=lenb;
lenb=bt;
}
for(i=0;i<=lena;i++)
{
sum[i]=c[i]+d[i]+sum[i];
if(sum[i]/10>0)
{
sum[i+1]=sum[i]/10;
sum[i]%=10;
}
}
printf("Case %d:\n",k);
k++;
printf("%s + %s = ",a,b);
if(sum[lena]!=0)
printf("%d",sum[lena]);
for(i=lena-1;i>=0;i--)
printf("%d",sum[i]);
printf("\n");
if(t!=0)
printf("\n");
}
return 0;
}
#include<string.h>
int main()
{
int t;
char a[1100],b[1100],beitai[1100];
int c[1100],d[1100],sum[1100];
int i,j,bt,k=1;
int lena,lenb;
scanf("%d",&t);
getchar();
while(t--)
{
scanf("%s %s",a,b);
getchar();
lena=strlen(a);
lenb=strlen(b);
memset(c,0,sizeof(c));
memset(d,0,sizeof(d));
memset(sum,0,sizeof(sum));
for(i=0,j=lena-1;i<lena;i++,j--)
c[j]=a[i]-'0';
for(i=0,j=lenb-1;i<lenb;i++,j--)
d[j]=b[i]-'0';
if(lena<lenb)
{
bt=lena;
lena=lenb;
lenb=bt;
}
for(i=0;i<=lena;i++)
{
sum[i]=c[i]+d[i]+sum[i];
if(sum[i]/10>0)
{
sum[i+1]=sum[i]/10;
sum[i]%=10;
}
}
printf("Case %d:\n",k);
k++;
printf("%s + %s = ",a,b);
if(sum[lena]!=0)
printf("%d",sum[lena]);
for(i=lena-1;i>=0;i--)
printf("%d",sum[i]);
printf("\n");
if(t!=0)
printf("\n");
}
return 0;
}