#include<iostream>
using namespace std;
int main() {
int n;
int a[3];
cin>>n;
for(int t=1;t<=n;t++) {
for(int i=0;i<3;i++)
cin>>a[i];
cout<<"Case "<<t<<": ";
if(a[0]+a[1]+a[2]<=2*max(a[0],max(a[1],a[2]))) {
cout<<"Invalid\n";
continue;
}
int ct = 0;
if(a[0]==a[1]) ct++;
if(a[1]==a[2]) ct++;
if(a[2]==a[0]) ct++;
string ans[4] = {"Scalene\n","Isosceles\n","","Equilateral\n"};
cout<<ans[ct];
}
}