#include <iostream>
using namespace std;
int main(int argc, char** argv){
long long int a,b,c,d,e;
cin>>a;
for(int i=1; i<=a; i++){
cin>>b>>c>>d;
if(c>b){
e=b;
b=c;
c=e;
}
if(d>b){
e=b;
b=d;
d=e;
}
e=b-c-d;
if(e<=0){
cout<<"Case "<<i<<": Invalid"<<endl;
}
else if(a==b||b==c){
cout<<"Case "<<i<<": Equilateral"<<endl;
}
else if(a==b){
cout<<"Case "<<i<<": Isosceles"<<endl;
}
else if(a==c){
cout<<"Case "<<i<<": Isosceles"<<endl;
}
else if(c==b){
cout<<"Case "<<i<<": Isosceles"<<endl;
}
else{
cout<<"Case "<<i<<": Scalene"<<endl;
}
}
}