Ordering teams problem beginner level.... please help ASAP

What is the wrong with my following code for ordering teams problem in beginner level ? What am i missing in the code as it is giving me wrong answer while submitting but giving wright answer in custom input compile in website compiler ?

t=int(input())
for i in range(t):
    s1=[int(x) for x in input().split()]
    s2=[int(x) for x in input().split()]
    s3=[int(x) for x in input().split()]
    c=0
    for i in range(3):
        if(s1[i]!=s2[i] and s2[i]!=s3[i]):
            c=1
            break
    if c==0:
        print("no")
    else:
        print("yes")