#include
#include
void sum(char *sum, char *a, char *b)
{
char *s_short, *s_long;
int i_short, i_long, i_result;
i_short = strlen(a) - 1;
i_long = strlen(b) - 1;
if(i_long >= i_short )
{
s_short = a;
s_long = b;
i_result = i_long + 1;
}
else
{
s_long = a;
s_short = b;
i_result = i_short;
i_short = i_long;
i_long = i_result;
i_result ++;
}
for(; i_short >= 0; i_short --, i_long --, i_result --)
{
sum[i_result] += s_short[i_short]- '0' + s_long[i_long] - '0';
sum[i_result - 1] = sum[i_result] / 10;
sum[i_result] %= 10;
sum[i_result] += '0';
}
for(; i_long >= 0; i_long --, i_result --)
{
sum[i_result] += s_long[i_long] - '0' ;
sum[i_result - 1] = sum[i_result] / 10;
sum[i_result] %= 10;
sum[i_result] += '0';
}
if(sum[0]) sum[0] += '0';
else
{
i_result = strlen(sum + 1);
memmove(sum, sum + 1, i_result);
sum[i_result] = 0;
}
}
int main(int argc, char **argv)
{
char a[1001] = {0}, b[1001] = {0}, r[1002] = {0};
int i, j = 0;
scanf("%d", &i);
while(j ++< i)
{
memset(r, 0, sizeof(r));
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
scanf("%s%s", a, b);
sum(r, a, b);
printf("Case %d:\n", j);
printf("%s + %s = %s\n", a , b, r);
if(j < i) printf("\n");
}
return 0;
}