from sys import stdout
n = int(input())
lis = ["Scalene","Isosceles","","Equilateral"]
for i in range(1,n+1) :
a = [int(s) for s in input().split()]
stdout.write("Case "+str(i)+": ")
if sum(a)<=2*max(a):
print("Invalid")
continue
ct = 0
if a[0]==a[1]: ct+=1
if a[1]==a[2]: ct+=1
if a[2]==a[0]: ct+=1
print(lis[ct])