#include<iostream>
using namespace std;
typedef long long LL;
bool judge(LL a){
LL sum = 0;
while(a){
sum += a%10;
a /= 10;
}
if(sum % 10 == 0)
return true;
else
return false;
}
int main(){
LL t,a,ca=1,b,c;
cin>>t;
while(t--){
cin>>a>>b;
--a;
while(!judge(a))--a;
while(!judge(b))--b;
cout<<"Case #"<<ca++<<": ";
cout<<b/10-a/10<<endl;
}
}
03-09