
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <utility>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using ll = long long;

using namespace std;

int N,X;
int d;

int main() {
	cin >> N >> X;
	rep(i,N) {
		cin >> d;
		if(d != X) cout << d << " ";
	}

	return 0;

}



#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<int> remove(int a,int b,vector<int> v){
    int target=b;
    vector<int> vec;
    for(int i{0};i<a;i++){
        if(target != v.at(i)){
            vec.push_back(v.at(i));
        }
    }
    return vec;
}
int main(){
    int a{};
    cin>>a;
    int b{};
    cin>>b;
    vector<int> vec;
    for(int i{0};i<a;i++){
        int num{};
        cin>>num;
        vec.push_back(num);
    }
    vector<int> v=remove(a,b,vec);
    for(auto c:v){
        cout<<c<<" ";
    }
    cout<<endl;
    return 0;
}