while True:
try:
n=int(input())
for i in range(n):
a,b,c=map(int,input().split())
if a<b+c and b<a+c and c<a+b:
if a==b==c:
print("1","1")
else: print("1","0")
else: print("0")
except:
break