Seungwon owns N artworks, numbered from 1 to N. Artwork i has size Ai and value Bi.
Today Seungwon wants to exhibit some of the artworks on the first floor of his mansion. He chooses the artworks to exhibit under the following condition.
Let Amax be the largest size and Amin the smallest size among the exhibited artworks, and let S be the sum of their values.
The quantity S−(Amax−Amin) must be as large as possible.
At least one artwork is exhibited. Given the sizes and values of the N artworks, write a program that finds the maximum possible value of S−(Amax−Amin).
Input
The first line contains the number of artworks N (2≤N≤500,000).
Each of the next N lines contains the size Ai and the value Bi of one artwork, in order from artwork 1 to artwork N. (1≤Ai≤1,000,000,000,000,000=1015, 1≤Bi≤1,000,000,000)
Output
Print the maximum value of S−(Amax−Amin) on the first line.
Hint
In the first sample, Seungwon owns 3 artworks with the following sizes and values.
Artwork 1 has size 2 and value 3.
Artwork 2 has size 11 and value 2.
Artwork 3 has size 4 and value 5.
Exhibiting artworks 1 and 3 gives S−(Amax−Amin)=6, which is the largest possible value.
The largest exhibited artwork is artwork 3, so Amax=4.
The smallest exhibited artwork is artwork 1, so Amin=2.