#include <iostream>
#include <vector>

using namespace std;

string cout_vector_separator = " ";
template<typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
    bool is_first = true;
    for (const auto& i : v) {
        if (is_first) is_first = false;
        else s << cout_vector_separator;
        s << i;
    }
    return s;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, x, a;
    cin >> n >> x;
    vector<int> b;
    b.reserve(n);
    for (int i = 0; i < n; ++i) {
        cin >> a;
        if (a != x) b.push_back(a);
    }
    cout << b << '\n';
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+5;
int a[maxn],n,k;
int main() {
	scanf("%d%d",&n,&k);
	for(register int i=1; i<=n; i++) {
		scanf("%d",&a[i]);
		if(a[i]==k)i--,n--;
	}
	for(register int i=1; i<=n; i++)printf("%d ",a[i]);
	return 0;
}
