#include <bits/stdc++.h>
#include <unordered_set>
#include <algorithm>
 
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repll(i,n) for (ll i = 0; i < (ll)(n); i++)
#define fore(x,a) for(auto&(x) : (a))
 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
#define ALL(a) (a).begin(), (a).end()
 
const ll INFL = 1e18;
const int INFI = 1e9;
const int MOD = 1e9 + 7;
 
int main(){
  ll N;
  cin >> N;
  vector<pll> x(N),y(N);
  repll(i,N) {
    ll X,Y;
    cin >> X >> Y;
    x[i] = make_pair(X,i);
    y[i] = make_pair(Y,i);
  }
  sort(ALL(x));
  sort(ALL(y));
  ll a,ax,ay,b;
  a = abs(x[N-1].first-x[0].first);
  ax = x[0].second;
  ay = x[N-1].second;
  if(abs(x[N-2].first-x[0].first)>abs(x[N-1].first-x[1].first)) {
    b = abs(x[N-2].first-x[0].first);
  }
  else {
    b = abs(x[N-1].first-x[1].first);
  }
  ll c,cx,cy,d;
  c = abs(y[N-1].first-y[0].first);
  cx = y[0].second;
  cy = y[N-1].second;
  if(abs(y[N-2].first-y[0].first)>abs(y[N-1].first-y[1].first)) {
    d = abs(y[N-2].first-y[0].first);
  }
  else {
    d = abs(y[N-1].first-y[1].first);
  }
  if(b > c) cout << b << endl;
  else if(d > a) cout << d << endl;
  else if(ax == cx && ay == cy) {
    cout << max(b,d) << endl;
  }
  else if(ax == cy && ay == cx) {
    cout << max(b,d) << endl;
  }
  else {
    cout << min(a,c) << endl;
  }
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mpi map<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define pl pair<ll,ll>
#define pi pair<int,int>
#define forn(i,n) for(ll i=0;i<n;i++)
#define ff first
#define ss second
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define inf       1000000000000
#define MOD       1000000007
ll binpow(ll a,ll b,ll m){
    a%=m;
    ll res=1;
    while(b>0){
        if(b&1)
            res=res*a%m;
        a=a*a%m;
        b>>=1;
    }
    return res;
}
void solve(){
    ll a,b;
    cin>>a>>b;
    for(ll i=b;i>=1;i--){
        ll k=b/i;
        if(k>=2){
            ll x=k-1;
            if(x*i>=a){
                cout<<i;
                return;
            }
        }
    }
}

int main(){
    ll t=1;
   // cin>>t;
    while(t--){
        solve();
		cout<<endl;
    }

    return 0;
}