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

int main(){
    int count_all_str;
    string search_str;
    string tmp;
    string new_str;
    cin >> count_all_str >> search_str;
    for(int i = 1;i <= count_all_str;i++){
        cin >> tmp;
        if(tmp != search_str){
            new_str += tmp;
            new_str += " ";
        }
        int size = new_str.size();
        if(i == count_all_str && size != 0){
            int size = new_str.size();
            new_str = new_str.replace(size - 1, 1, "");
        }
    }
    cout << new_str << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
using P = pair<int,int>;
using ll = long long;

int main() {
    int n,x;
    cin >> n >> x;

    int a[n];
    rep(i,n){
        cin >> a[i];
    }

    vector<int> ans;

    rep(i,n){
        if(a[i]!=x){
            ans.push_back(a[i]);
        }
    }

    rep(i,ans.size()){
        if(i==ans.size()-1){
            cout << ans.at(i);
        }
        else{
            cout << ans.at(i) << ' ';
        }
    }
    cout<< endl;



}