x=int(input())
for i in range(1,(x+1)):
y=list(map(int,input().split()))
y.sort()
if (y[0]+y[1]<y[2])or(y[0]<=0)or(y[1]<=0)or(y[2]<=0):
print("Case ",i,": Invalid",sep="")
elif (y[0]==y[1])and(y[1]==y[2]):
print("Case ",i,": Equilateral",sep="")
elif (y[0]==y[1])or(y[1]==y[2]):
print("Case ",i,": Isosceles",sep="")
else:
print("Case ",i,": Scalene",sep="")
if (y[0]+y[1]<y[2])or(y[0]<=0)or(y[1]<=0)or(y[2]<=0):
y[0]+y[1]剛好等於y[2]也無法形成三角形
if (y[0]+y[1]
y[0]+y[1]剛好等於y[2]也無法形成三角形
AC了!!謝謝<3