#include<iostream>
#include<string>
using namespace std;
typedef long long ll;

int main() {
	ll n,x;
	ll a[100001];
	ll b = 0,c=0;
	cin >> n>>x;

	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] == x) {
			b += 1;
		}
		else {
			c = i;
		}
	}
	if (b == n) {
		cout << " " << endl;
	}else {
		for (ll i = 0; i < n; i++) {
			if (i == c) {
				cout << a[i] << endl;
			}
			else {
				if (a[i] != x) {
					cout << a[i] << " ";
				}

			}
		}
	}


	return 0;
}
/**
 * @author: adityasonani
 * */
#include <bits/stdc++.h>

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")

#define     ll          long long
#define     ld        	long double
#define     ln          "\n"
#define     fastio      ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define     MOD         (int) 1000000007
#define     rep(i, n)   for (int i = 0; i < (int)n; i++)
#define     all(x)      (x).begin(), (x).end()
#define     debug(x)    cerr << #x << " = " << x << endl;
#define     precise(x)  cout << fixed << setprecision(x)
#define     MAX         (int) 10000007 // 10^7

using namespace std;

/*
*/

void solve()
{
    int n, k;
    cin>>n>>k;

    rep(i, n)  {
        int a;
        cin>>a;
        if(a!=k) cout << a << " ";
    } 
}

signed main()
{
    fastio;

    auto start = std::chrono::high_resolution_clock::now();

    int t=1;
    // cin>>t;

    while(t--)
        solve();

    auto stop = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);

    // cerr << "\nTime taken : " << ((long double)duration.count())/((long double) 1e9) <<" s "<< endl;

    return 0;
}
