Uefa problem statement

cook your dish here

import sys

t = int(input())
for _ in range(t):
teams={}
d=[]
for i in range(12):
n= sys.stdin.readline().split()
d.append(n)
for i in d:
teams[i[0]]=[0,0,0]
for game in d:
for team in teams:
if team ==game[0]:
teams[game[0]][1]+=int(game[1])
teams[game[0]][2]+=int(game[3])
elif team==game[4]:
teams[game[4]][1]+=int(game[3])
teams[game[4]][2]+=int(game[1])
if int(game[1])>int(game[3]):
teams[game[0]][0]+=3
elif int(game[1])<int(game[3]):
teams[game[4]][0]+=3
elif int(game[1])==int(game[3]):
teams[game[0]][0]+=1
teams[game[4]][0]+=1
output=[]
for i in range(2):
maxi=0
best=’’
diff=0
for team in teams:
if (teams[team][0]>=maxi and teams[team][1]-teams[team][2]>diff):
maxi=teams[team][0]
diff=teams[team][1]-teams[team][2]
best=team
output.append(best)
del teams[best]
print (output[0],output[1])

My code is working fine while running in the codechef IDE but is throwing this nzec error while submitting can please someone look at it I can’t seem to understand what’s the problem here.