Help me in solving PROGLANG problem

My issue

My code

# cook your dish here


Problem Link: PROGLANG Problem - CodeChef

</>
for t in range(int(input())):
A,B,A1,B1,A2,B2=map(int,input().split())
if (A==A1 or A==B1) and (B==A1 or B==B1 ):
print(1)
elif (A==A2 or A==B2) and (B==A2 or B==B2 ):
print(2)
else:
print(0)

t=int(input())
while t:
a,b,a1,b1,a2,b2=map(int,input().split())
s=set((a,b))
s1=set((a1,b1))
s2=set((a2,b2))
if(s==s1):
print(1)
elif(s==s2):
print(2)
else:
print(0)
t-=1