# Doubt in CHANDF Problem

can someone find what is the error in my code it only passes for 1st testcase set
t=int(input())
for i in range(t):
x,y,l,r=map(int,input().split())
x1=bin(x)
y1=bin(y)
x1=list(x1[2:])
y1=list(y1[2:])
l1=bin(l)
l1=list(l1[2:])
r1=bin®
r1=list(r1[2:])
q=max(len(x1),len(y1),len(l1),len(r1))
for j in range(q-len(x1)):
x1.insert(0,‘0’)
for j in range(q-len(y1)):
y1.insert(0,‘0’)
for j in range(q-len(l1)):
l1.insert(0,‘0’)
for j in range(q-len(r1)):
r1.insert(0,‘0’)
for j in range(len(l1)):
if(l1[j]!=r1[j]):
k=j
break
z1=[l1[j] for j in range(len(l1))]
z2=[r1[j] for j in range(len(r1))]
z1[k]=‘0’
z2[k]=‘1’
for j in range(k+1,len(z1)):
z1[j]=‘1’
for j in range(q):
if((x1[j]==‘0’ and y1[j]==‘0’) and j>k):
z1[j]=‘0’
for j in range(k+1,len(r1)):
if(r1[j]==‘1’):
k1=j
break
for j in range(k1,len(z2)):
z2[j]=‘0’
for j in range(q):
if((x1[j]==‘0’ and y1[j]==‘0’) and j>k1):
z2[j]=‘0’
z11="".join(z1)
z22="".join(z2)
z11=int(z11,2)
z22=int(z22,2)
q1=[l,r,z11,z22]
q1.sort()
q2=[]
for j in range(len(q1)):
q2.append((x&q1[j])*(y&q1[j]))
print(q2)
print(q1[q2.index(max(q2))])