#!/usr/bin/env python3
n = int(input())
events = []
for i in range(n):
    t, x = map(int, input().split())
    events.append((t, x))
events.sort()
L = events[0][1]
R = events[0][1]
ans = 0
for i in range(1, n):
    dt = events[i][0] - events[i-1][0]
    x = events[i][1]
    L += dt
    R -= dt
    L = min(L, x)
    R = max(R, x)
    ans = max(ans, R-L)
print(ans)
