#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int t;
long long int a[3];
cin >> t;
for (int i=1; i<=t; i++){
cin >> a[0] >> a[1] >> a[2];
sort(a, a+3);
cout <<"Case "<< i;
if (a[0]<=0){
cout <<": Invalid"<<endl;
}
else if (a[0]==a[2]){
cout <<": Equilateral"<<endl;
}
else if (a[0]==a[1] || a[1]==a[2]){
cout <<": Isosceles"<<endl;
}
else if (a[0]+a[1]>a[2]){
cout <<": Scalene"<<endl;
}
else {
cout <<": Invalid"<<endl;
}
}
}