/// Raihan Ruhin
/// CSE, Jahangirnagar University.
/// Dhaka-Bangladesh.
/// id: raihanruhin (topcoder / codeforces / codechef / hackerrank), 3235 (lightoj)
/// mail: raihanruhin@ (yahoo / gmail / facebook)
/// blog: ruhinraihan.blogspot.com
#include<bits/stdc++.h>
using namespace std;
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define PI acos(-1.0)
#define MOD 1000000007
#define MX 100010
string stringMult(string num1, string num2)
{
int l1=num1.size(), l2=num2.size(); //length of two arrays.
int mx=l1+l2;
int arr[mx]; //temporary integer array for intermediate calculation.
CLR(arr); //set all value with 0
int n1[l1], n2[l2]; //correspondent integer array of two string.
//ASCII to number
for(int i=0; i<l1; i++) n1[i]=num1[i]-'0';
for(int i=0; i<l2; i++) n2[i]=num2[i]-'0';
//calculation
for(int i=l1-1; i>=0; i--)
for(int j=l2-1; j>=0; j--)
arr[i+j+1]+=n1[i]*n2[j];
//carry
for(int i=mx-1; i>0; i--)
if(arr[i]>9)
{
arr[i-1]+=arr[i]/10;
arr[i]=arr[i]%10;
}
//eliminate starting zeros.
int pos=0;
while(!arr[pos]) pos++;
//store to a string
string s="";
for(int i=pos;i<mx;i++)
s+=arr[i]+'0';
return s;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int tc,kk=1, n;
cin>>tc;
while(tc--)
{
string a, b;
cin>>a>>b;
cout<<"Case "<<kk++<<": "<<stringMult(a, b)<<endl;
}
return 0;
}
Ly8vICAgICBSYWloYW4gUnVoaW4KLy8vICAgICBDU0UsIEphaGFuZ2lybmFnYXIgVW5pdmVyc2l0eS4KLy8vICAgICBEaGFrYS1CYW5nbGFkZXNoLgovLy8gICAgIGlkOiByYWloYW5ydWhpbiAodG9wY29kZXIgLyBjb2RlZm9yY2VzIC8gY29kZWNoZWYgLyBoYWNrZXJyYW5rKSwgMzIzNSAobGlnaHRvaikKLy8vICAgICBtYWlsOiByYWloYW5ydWhpbkAgKHlhaG9vIC8g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ICBhcnJbaStqKzFdKz1uMVtpXSpuMltqXTsKICAgIC8vY2FycnkKICAgIGZvcihpbnQgaT1teC0xOyBpPjA7IGktLSkKICAgICAgICBpZihhcnJbaV0+OSkKICAgICAgICB7CiAgICAgICAgICAgIGFycltpLTFdKz1hcnJbaV0vMTA7CiAgICAgICAgICAgIGFycltpXT1hcnJbaV0lMTA7CiAgICAgICAgfQogICAgLy9lbGltaW5hdGUgc3RhcnRpbmcgemVyb3MuCiAgICBpbnQgcG9zPTA7CiAgICB3aGlsZSghYXJyW3Bvc10pIHBvcysrOwogICAgLy9zdG9yZSB0byBhIHN0cmluZwogICAgc3RyaW5nIHM9IiI7CiAgICBmb3IoaW50IGk9cG9zO2k8bXg7aSsrKQogICAgICAgIHMrPWFycltpXSsnMCc7CnJldHVybiBzOwp9CgppbnQgbWFpbigpCnsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7CiAgICBjaW4udGllKDApOwogICAgaW50IHRjLGtrPTEsIG47CiAgICBjaW4+PnRjOwoKICAgIHdoaWxlKHRjLS0pCiAgICB7CiAgICAgICAgc3RyaW5nIGEsIGI7CiAgICAgICAgY2luPj5hPj5iOwogICAgICAgIGNvdXQ8PCJDYXNlICI8PGtrKys8PCI6ICI8PHN0cmluZ011bHQoYSwgYik8PGVuZGw7CiAgICB9CiAgICByZXR1cm4gMDsKfQoK