Time limit
1s
Memory limit
128 MB
An intelligent train runs through four stations in order, from station 1 (the departure station) to station 4 (the terminal station). At each station, all passengers getting off leave the train before new passengers board.
Given the number of passengers who get off and board at each station, find the maximum number of passengers that were on the train at any point during the trip.
The train satisfies the following conditions.
Four lines are given. On the i-th line, two integers are given separated by a space: the number of passengers getting off at station i and the number of passengers boarding at station i.
Print the maximum number of passengers that were on the train during the trip.