import datetime # date and time in yyyy/mm/dd hh:mm:ss format d1 = datetime.datetime(2022, 10, 11, 22, 50, 55) d2 = datetime.datetime(2022, 5, 11, 22, 50, 55) print(d1 > d2) True import datetime # date and time in yyyy/mm/dd hh:mm:ss format d1 = datetime.datetime(2022, 10, 11, 22, 50, 55) d2 = datetime.datetime(2022, 10, 11, 22, 50, 55) print(d1 == d2) True t=int(input()) for i in range(t): a,b,a1,b1,a2,b2=map(int,input().split()) if ((a,b)==(a1,b1)) or ((a,b)==(b1,a1)): print(1) elif ((a,b)==(a2,b2)) or ((a,b)==(b2,a2)): print(2) else: print(0)