lead the game

T=int(input())
res=[]
temp=[]
for i in range(T):
a,b = input().split()
if(int(a)>int(b)):
res.append([1,int(a)-int(b)])
else:
res.append([2,int(b)-int(a)])
#print(res)
for i in range(len(res)):
temp.append(res[i][1])
for i in range(len(temp)):
if res[i][1]==max(temp):
print(res[i][0], res[i][1] )

why thi code is wrong