Code working well in another IDE but throwing NZEC runtime error on codechef!

n=int(input())
L1=[]
L2=[]
for i in range(n):
A,B=input().split()
L1.append(int(A))
L2.append(int(B))
L3=[]
max=0
TL=0
for j in range(n):
L3.append(abs(L1[j]-L2[j]))
if L3[j]>max:
max=L3[j]
if L1[j]>L2[j]:
TL=1
else:
TL=2
print(TL)

#The above is my code for the problem Problem statement