#include <iostream>
#include <vector>
#include <string>
#include <array>
#include <functional>
#include <algorithm>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <bitset>
#include <cassert>
#include <math.h>
#include <complex>
#include <iomanip>
#include <unordered_map>
using namespace std;
#define ll long long
#define pb(x) push_back(x)
#ifdef _OLIMPOLOCAL
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 1337
#endif
void debug_out() { cout << "\n";}
template<typename T1, typename... T2> void debug_out(T1 A, T2... B) { cout << " " << A; debug_out(B...); }
int test = 1;
#define out(x) {cout << x << "\n";return;}
#define all(N) N.begin(),N.end()
#define allr(N) N.rbegin(),N.rend()
template<typename T1> 
void print(vector<T1> V, int add = 0, int start = -1, int end = -1) {
    if (start < 0) start = 0;
    if (end < 0) end = V.size() - 1;
    for (int i = start; i <= end; i++) {
        cout << V[i] + add << ((i == end) ? "\n" : " ");
    }
}
template<typename T1> 
T1 chmin(T1 &x, const T1 v) { return x = min(x,v); }
template<typename T1> 
T1 chmax(T1 &x, const T1 v) { return x = max(x,v); }
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, s, n) for (int i = s; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define repsr(i, s, n) for (int i = n-1; i >= s; i--)
//-------------------------- ^ DONT TOUCH ^-----------------------------------------------------------------
#define MAX 1001
#define MOD 1000000007ll

ll n, m, q, x, y;
void solve() {
    cin >> n >> x;
    vector<int> N;
    rep(i,n) {
        cin >> y;
        if (x != y) 
            N.push_back(y);
    }
    print(N);
}

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    int test = 1;
    #ifdef _OLIMPOLOCAL
        cin >> test;
    #endif   
    rep(testCase, test) {
        #ifdef _OLIMPOLOCAL
            cout << "------------------ TESTCASE: " << testCase << " -------------\n";
        #endif
        solve();
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll> ;
#define rep(i,n) for(ll i=0;i<(n);i++)
ll min(ll a,ll b){return a>=b ? b:a;}
ll max(ll a,ll b){return a>=b ? a:b;}
int main(){
    ll n;
    cin >> n;
    vector<P> X(n);
    vector<P> Y(n);
    rep(i,n){
        ll x,y;
        cin >> x >> y;
        X[i].first=x;
        X[i].second=i;
        Y[i].first=y;
        Y[i].second=i;
    }
    sort(X.begin(),X.end());
    sort(Y.begin(),Y.end());
    vector<ll> M(3,0);
    vector<ll> S(3);
    for (ll i=1;i>=0;i--){
        for (ll j=n-2;j<n;++j){
            if (M[0]<=abs(X[i].first-X[j].first)){
                copy(M.begin(),M.end(),S.begin());
                M[0]=abs(X[i].first-X[j].first);
                M[1]=X[i].second;
                M[2]=X[j].second;
            }else if (S[0]<=abs(X[i].first-X[j].first)){
                S[0]=abs(X[i].first-X[j].first);
                S[1]=X[i].second;
                S[2]=X[j].second;
            }
            if (M[0]<=abs(Y[i].first-Y[j].first)){
                if (M[1]==Y[i].second && M[2]==Y[j].second) continue;
                copy(M.begin(),M.end(),S.begin());
                M[0]=abs(Y[i].first-Y[j].first);
                M[1]=Y[i].second;
                M[2]=Y[j].second;
            }else if (S[0]<abs(Y[i].first-Y[j].first)){
                S[0]=abs(Y[i].first-Y[j].first);
                S[1]=Y[i].second;
                S[2]=Y[j].second;
            }
        }
    }
    cout << S[0] << endl;
}