https://www.acmicpc.net/problem/2455
sum=0 max=0 for i in range(4): a,b=map(int,input().split()) sum+=-a+b if sum>=max: max=sum print(max)