The
first line contains a single number n (2 ≤ n ≤ 1000) — the number of the tram's
stops.
Then n lines follow, each contains two integers ai and bi (0 ≤ ai, bi ≤ 1000) — the number
of passengers that exits the tram at the i-th stop, and
the number of passengers that enter the tram at the i-th stop. The
stops are given from the first to the last stop in the order of tram's
movement.
The
number of people who exit at a given stop does not exceed the total number of
people in the tram immediately before it arrives at the stop. This particularly
means that a1 = 0.
At the
last stop, all the passengers exit the tram and it becomes empty.
No
passenger will enter the train at the last stop. That is, bn = 0.