def tournamentWinner(competitions, results):
# Write your code here.
dic = {}
for i in range(len(results)):
index = None
winning_team = results[i]
if winning_team == 0:
index = 1
else:
index = 0
winner = competitions[i][index]
if winner not in dic:
dic[winner] = 3
else:
dic[winner] += 3
res = sorted(dic.items(), key = lambda item: item[1], reverse=True)
return res[0][0]