https://www.codechef.com/IARCSJUD/problems/LEADGAME

the following code works fine but i am not able to submit it . can anyone spot the obvious that i might be missing?

l1=[]
l2=[]
n=int(input())
for _ in range(n):
p1,p2=map(int,str(input()).split())
l1.append([p1,p2])
for x in l1:
if x[0]>x[1]:
l2.append([1,abs(x[0]-x[1])])
else:
l2.append([2,abs(x[0]-x[1])])
l2.sort(key = lambda x: x[1])
print(l2[n-1][0],l2[n-1][1])

Replace

l1.append([p1,p2])

With

sum1+=p1
sum2+=p2
l1.append([sum1,sum2])

Where sum1 and sum2 are global variables initialised with 0.
I hope you know the sum said maximum cumulative lead.

oh sorry . I totally missed out on that. I total it was for each round and not the sum.
i am just a beginner . thanks for the help