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

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

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

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