Help me in solving WATCHFB problem

My issue

for _ in range(int(input())):
n=int(input())
ans=
max_b,max_c=0,0
for i in range(n):
a,b,c=map(int,input().split())
if a==1:
ans.append(“YES”)
elif b==c:
ans.append(“YES”)
elif i==0 and a==2:
ans.append(“NO”)
elif min(b,c)<max(max_b,max_c):
ans.append(“YES”)
else:
ans.append(“NO”)
max_b=max(max_b,b)
max_c=max(max_c,c)
for j in range(n):
print(ans[j])
am i missing some edge case pls help

My code

for _ in range(int(input())):
    n=int(input())
    ans=[]
    max_b,max_c=0,0
    for i in range(n):
        a,b,c=map(int,input().split())
        if a==1:
            ans.append("YES")
        elif b==c:
            ans.append("YES")
        elif i==0 and a==2:
            ans.append("NO")
        elif min(b,c)<max(max_b,max_c):
            ans.append("YES")
        else:
            ans.append("NO")
        max_b=max(max_b,b)
        max_c=max(max_c,c)
    for j in range(n):
        print(ans[j])

Problem Link: Chef and Football Match Practice Coding Problem - CodeChef