max=0 number=0 for i in range(10): sub, add=map(int, input().split()) number-=sub number+=add if max<number: max=number print(max)