#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv)
{
long long int t,a,b,c;
while(cin>>t)
{
for(int i=1; i<=t; i++)
{
a=0;b=0;c=0;
cin>>a>>b>>c;
if(a<=0 || b<=0 || c<=0 ) //side won't be 0 or -
{
// Case 1: Invalid
cout<<"Case "<<i<<": Invalid"<<endl;
}else if((a+b>c ) &&( a-b<c) )//triangle
{
if((a==b) && (b==c)) //正三角形
{
cout<<"Case "<<i<<": Equilateral"<<endl;
}else if((a==b) && (b!=c)) //等腰
{
cout<<"Case "<<i<<": Isosceles"<<endl;
} else
{
cout<<"Case "<<i<<": Scalene"<<endl;
}
}else
{
cout<<"Case "<<i<<": Invalid"<<endl;
}
}
}
//return 0;
}