SAMESNAK : Getting WA

In this code i am getting wrong answer even though i am getting correct output.
Question link : CodeChef: Practical coding for everyone
My solution code
Please anyone check the mistake and tell me.
Thanks

#solution
t = int(input())
for _ in range(t):
x1 = list(map(int,input().split(’ ‘)))
x2 = list(map(int, input().split(’ ')))

if x1[1] == x1[3] == x2[1] == x2[3]:
    if x2[0] > x1[0]:
        if x1[2] > x2[2]:
            flag = 1
        else:
            flag = 0
    else:
        flag = 0

else:
    if (x1[0]==x2[0] and x1[1]==x2[1]) or \
            (x1[0]==x2[2] and x1[1]==x2[3]) or \
            (x1[2]==x2[0] and x1[3]==x2[1]) or \
            (x1[2]==x2[2] and x1[3]==x2[3]):
        flag = 1
    else:
        flag = 0





if flag == 1:
    print('Yes')
else:
    print("No")