#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int min(int a, int b) { if (a > b) return b; return a; }
int max(int a, int b) { if (a < b) return b; return a; }
int sgn(int a) { return a/abs(a); }
#define rep(E, F) for (E = 0; E < (F); E++)
#define per(E, F) for (E = (F) - 1; E >= 0; E--)
#define MAXN 1000000
#define INF 1000000000
typedef struct { int x, y, z; } par;
par a[MAXN], b[MAXN];
int get_int()
{
	int r = 0, c = getchar(), s = 1;
	while (c != '-' && c < '0' || c > '9') c = getchar();
	while (c == '-') s *= -1, c = getchar();
	while (c >= '0' && c <= '9') r = r*10 + c - '0', c = getchar();
	return s*r;
}

int move(int x, int y, int t)
{ // try to go from x to y, but you only have t seconds.
	return abs(y - x) <= t ? y : x + sgn(y - x)*t;
}

int check(int n, int m)
{
	int i, l = b[0].y - m, r = b[0].x;
	rep(i, n) if (i != 0)
	{
		l = move(l, b[i].y - m, b[i].z - b[i - 1].z);
		r = move(r, b[i].x, b[i].z - b[i - 1].z);
		if (b[i].x < l || b[i].y - m > r) return 0;
		l = max(l, b[i].y - m);
		r = min(r, b[i].x);
	}
	return 1;
}

int cmp(const void *p1, const void *p2) { return *(int*)p1 - *(int*)p2; }

int main()
{
	int i, j, k = 0, n = get_int(), r, s;
	rep(i, n) a[i].x = get_int(), a[i].y = get_int();
	qsort(a, n, sizeof *a, cmp);
	i = 0;
	while (i < n)
	{
		j = i;
		b[k].x = INF, b[k].y = -INF, b[k].z = a[i].x;
		while (j < n && a[i].x == a[j].x) b[k].x = min(b[k].x, a[j].y), b[k].y = max(b[k].y, a[j].y), j++;
		k++;
		i = j;
	}
	r = 0, s = 1e9 + 1;
	while (r < s)
	{
		int m = (r + s)/2;
		if (!check(k, m)) r = m + 1;
		else s = m;
	}
	printf("%d\n", r);
	return 0;
}
