Why i am getting wrong answer?

n=int(input())
diff=0
lead=0
leadingplayer=0
for i in range(n):
a,b=input().split()
a=int(a)
b=int(b)
diff=abs(a-b)
if lead<diff:
lead=diff
if a>b:
leadingplayer=1
elif b>a:
leadingplayer=1
print(str(leadingplayer)+" "+str(lead))
This is my code for TLG problem that is very basic problem here and i think it is optimal solution to this problem also .And before codechef i am familiar with CP rules also but i dont know why this is giving Wrong answer.Please help

The code is not readable. Please post the link of your submission.