#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	vector<pair<long long,long long>> a(n);
	for (auto &[t,x]: a) cin >> t >> x;
	ranges::sort(a);

	auto solve = [&](long long w) {
		long long xmin = 0, xmax = 0, pt = -1e12;
		for (auto [t,x]: a) {
			long long dt = t-pt;
			long long nxmin = max(xmin-dt, x-w);
			long long nxmax = min(xmax+dt, x);
			xmin = nxmin, xmax = nxmax, pt = t;
			if (xmin > xmax) return false;
		}
		return true;
	};

	long long lo = -1, hi = 1e12;
	while (hi-lo > 1) {
		long long md = (lo+hi)/2;
		(solve(md) ? hi : lo) = md;
	}
	cout << hi << endl;
}
