#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <cassert>
#include <cmath>
using namespace std;

struct StronglyConnectedComponent {
        int n;
        vector<bool> used;
        vector<int> order, cmp;
        vector<vector<int>> g, rg;
        StronglyConnectedComponent(int x) {
                n = x;
                g.resize(x);
                rg.resize(x);
                used.resize(x);
                cmp.resize(x);
        }
        void add_edge(int from, int to) {
                //cerr << "add_edge = " << from << ' ' << to << endl;
                g[from].push_back(to);
                rg[to].push_back(from);
        }
        void dfs(int u) {
                used[u] = true;
                for (auto v : g[u]) if (!used[v]) {
                        dfs(v);
                }
                order.push_back(u);
        }
        void rdfs(int u, int k) {
                used[u] = true;
                cmp[u] = k;
                for (auto v : rg[u]) if (!used[v]) {
                        rdfs(v, k);
                }
        }
        int init() {
                used.assign(n, false);
                for (int u = 0; u < n; u ++) {
                        if (!used[u]) {
                                dfs(u);
                        }
                }
                used.assign(n, false);
                int k = 0;
                for (int i = order.size() - 1; i >= 0; i --) {
                        if (!used[order[i]]) {
                                rdfs(order[i], k ++);
                        }
                }
                return k;
        }
};

static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;

int main() {
        int n;
        scanf("%d", &n);
        vector<pair<long long, int>> flags; 
        long long mi = INFL, ma = -1;
        for (int i = 0; i < n; i ++) {
                long long x, y;
                scanf("%lld %lld", &x, &y);
                flags.emplace_back(x, i);
                flags.emplace_back(y, i);
                mi = min(mi, x);
                mi = min(mi, y);
                ma = max(ma, x);
                ma = max(ma, y);
        }
        sort(flags.begin(), flags.end());
        vector<vector<int>> pos(n);
        for (int i = 0; i < flags.size(); i ++) {
                pos[flags[i].second].push_back(i);
        }
        const int leaves = pow(2, ceil(log2(2 * n)));
        const int N = 2 * leaves - 1;
        function<bool (long long)> check = [&](long long dist) {
                StronglyConnectedComponent scc(N * 2); //0 ~ 2*n-2 : x, 2*n-1 ~ 4*n-3 : not x
                function<void (int)> update = [&](int k) {
                        k += leaves - 1;
                        while (k > 0) {
                                scc.add_edge(k, (k - 1) / 2);
                                //scc.add_edge((k - 1) / 2 + N, k + N);
                                k = (k - 1) / 2;
                        }
                };
                function<void (int, int, int, int, int, int)> query = [&](int a, int b, int k, int l, int r, int idx) {
                        if (r <= a || b <= l) return;
                        if (a <= l && r <= b) {
                                scc.add_edge(idx, k + N);
                                scc.add_edge(k, idx + N);
                                return;
                        } else {
                                int m = (l + r) / 2;
                                query(a, b, k * 2 + 1, l, m, idx);
                                query(a, b, k * 2 + 2, m, r, idx);
                        }
                };
                function<void (int, int, int)> query2 = [&](int a, int b, int idx) {
                        query(a, b, 0, 0, leaves, idx); 
                };
                //cerr << "---------------------first-------------------------" << endl;
                for (int i = 0; i < n; i ++) {
                        assert(pos[i].size() == 2);
                        update(pos[i][0]);
                        update(pos[i][1]);
                        int a = pos[i][0] + leaves - 1;
                        int b = pos[i][1] + leaves - 1;
                        scc.add_edge(a, b + N);
                        scc.add_edge(a + N, b);
                        scc.add_edge(b, a + N);
                        scc.add_edge(b + N, a);
                }
                vector<long long> flag_pos;
                for (int i = 0; i < flags.size(); i ++) {
                        flag_pos.push_back(flags[i].first);
                }
                //cerr << "---------------------second-------------------------" << endl;
                for (int i = 0; i < flag_pos.size(); i ++) {
                        long long x = flag_pos[i];
                        long long left = x - dist;
                        long long right = x + dist;
                        int l = upper_bound(flag_pos.begin(), flag_pos.end(), left) - flag_pos.begin();
                        int r = lower_bound(flag_pos.begin(), flag_pos.end(), right) - flag_pos.begin();
                        //cerr << "l, r = " << l << ' ' << r << endl;
                        query2(l, i, i + leaves - 1);
                        query2(i + 1, r, i + leaves - 1);
                }
                scc.init();
                for (int i = 0; i < N; i ++) {
                        if (scc.cmp[i] == scc.cmp[i + N]) {
                                return false;
                        }
                }
                return true;
        };
        long long lb = 0, ub = (ma - mi) / (n - 1) + 1;
        //int c = 4;
        //cerr << "check(" << c << ") = " << check(c) << endl;
        while (ub - lb > 1) {
                long long mid = (lb + ub) / 2;
                //cerr << mid << endl;
                if (check(mid)) lb = mid;
                else ub = mid;
        }
        printf("%lld\n", lb);
}



Measured memory_bytes: 31616