#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 21000






int main() {
	int a[N][2];
	bool used[N][2];
	bool used2[N];
	int cuse;
	int l, r, m;
	vector<pair<int, int> >b;
	vector<int>c;
	queue<int> q;
	int n, k, kk;
	int x, y, z, xx, yy;
	long long s, ans;
	bool v = true;
	ans = 0;
	scanf("%d", &n);
	f(i, n) {
		scanf("%d %d", &a[i][0], &a[i][1]);
		b.push_back(make_pair(a[i][0], (2 * i)));
		b.push_back(make_pair(a[i][1], (2 * i) + 1));
	}
	sort(b.begin(), b.end());
	l = -1;
	r = 1000000000;
	while ((l + 1) < r) {
		m = (l + r) / 2;
		v = true;
		f(i, n) {
			used[i][0] = false;
			used[i][1] = false;
			used2[i] = false;
		}
		f(i, n) {
			if (used2[i] == false) {
				while (!q.empty())q.pop();
				c.clear();
				c.push_back(i);
				q.push((2 * i));
				while (!q.empty()) {
					x = q.front();
					y = x % 2;
					x = x / 2;
					q.pop();
					if (!used2[x]) {
						if (used[x][y]) {
							v = false;
							break;
						}
						else {
							used[x][y] = true;
							used2[x] = true;
							z = a[x][y] - m;
							kk = 0;
							while (kk < (2 * n)) {
								if (b[kk].first > (a[x][y] + m))break;
								if (b[kk].first < (a[x][y] - m)) {
									if ((kk + 140) < (2 * n)) {
										if (b[kk + 140].first < (a[x][y] - m))kk += 140;
										else kk++;
									}
									else kk++;
								}
								else {
									xx = b[kk].second / 2;
									yy = b[kk].second % 2;
									if (!used[xx][yy]) {
										used[xx][yy] = true;
										c.push_back(xx);
										yy = (yy + 1) % 2;
										z = (xx * 2) + yy;
										if (!used2[xx]) {
											if (used[xx][yy]) {
												v = false;
												break;
											}
											else q.push(z);
										}
									}
									kk++;
								}
							}
							if (!v)break;
						}
					}
				}
				if (!v) {
					f(i, c.size()) {
						used[c[i]][0] = false;
						used[c[i]][1] = false;
						used2[c[i]] = false;
					}
					v = true;
					while (!q.empty())q.pop();
					c.clear();
					c.push_back(i);
					q.push((2 * i) + 1);
					while (!q.empty()) {
						x = q.front();
						y = x % 2;
						x = x / 2;
						q.pop();
						if (!used2[x]) {
							if (used[x][y]) {
								v = false;
								break;
							}
							else {
								used[x][y] = true;
								used2[x] = true;
								z = a[x][y] - m;
								kk = 0;
								while (kk < (2 * n)) {
									if (b[kk].first > (a[x][y] + m))break;
									if (b[kk].first < (a[x][y] - m)) {
										if ((kk + 140) < (2 * n)) {
											if (b[kk + 140].first < (a[x][y] - m))kk += 140;
											else kk++;
										}
										else kk++;
									}
									else {
										xx = b[kk].second / 2;
										yy = b[kk].second % 2;
										if (!used[xx][yy]) {
											used[xx][yy] = true;
											c.push_back(xx);
											yy = (yy + 1) % 2;
											z = (xx * 2) + yy;
											if (!used2[xx]) {
												if (used[xx][yy]) {
													v = false;
													break;
												}
												else q.push(z);
											}
										}
										kk++;
									}
								}
								if (!v)break;
							}
						}
					}
				}

			}
			if (!v)break;
		}
		if (v)l = m;
		else r = m;
	}

	printf("%d\n", l + 1);


	return 0;
}


Measured memory_bytes: 640