#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define eb emplace_back
#define unused [[maybe_unused]]
#define tempT template<class T>
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << '\n'
#define ans_exit(x) { cout << x << endl; exit(0); }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (ll i = (ll)(n); i < (ll)(m); i++)

using ll   unused = long long;
using ld   unused = long double;
using vl   unused = vector<ll>;
using vvl  unused = vector<vl>;
using vvvl unused = vector<vvl>;
using lp   unused = pair<ll, ll>;
using lmap unused = map<int, int>;

unused constexpr ll MOD = 1e9 + 7;
unused constexpr ll INF = 1 << 30;
unused constexpr ll LINF = 1LL << 62;
unused constexpr int DX[8] = {0, 1, 0,-1, 1, 1,-1,-1};
unused constexpr int DY[8] = {1, 0,-1, 0, 1,-1, 1,-1};
unused inline bool bit(ll b, ll i) { return b & (1LL << i); }
unused inline ll ceiv(ll a, ll b) { return (a + b - 1) / b; }
unused inline ll mod(ll a, ll m = MOD) { return (a % m + m) % m; }
tempT unused bool chmin(T &a, T b) { if(a > b) {a = b; return 1;} return 0; }
tempT unused bool chmax(T &a, T b) { if(a < b) {a = b; return 1;} return 0; }

int main() {
    ll n, x;
    cin >> n >> x;
    vl ans;
    rep(i, n) {
        ll a; cin >> a;
        if(a != x) ans.pb(a);
    }
    rep(i, ans.size() - 1) {
        cout << ans[i] << " ";
    }
    if(ans.size() > 0) cout << ans.back();
    cout << endl;
}
#include <bits/stdc++.h>
using namespace std;
 
int main(){
 long long N, X;
 vector<long long> A;
 cin >> N >> X;
  
 long long temp;
 long long a_cnt = 0;
  
  for(long long i = 0; i<N; i++){
    cin >>temp;
    if(temp != X){
      A.push_back(temp);
      cout << A[a_cnt] << " " ;
      a_cnt++;
    }
  }
}