#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)//rep(i,回数){処理}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    ll n, x, a, count=0;
    cin >> n >> x;
    
    vector<ll> ans(n);
    rep(i,n) {
        cin >> a;
        if (a != x) {
            ans[count] += a;
            count++;
        }
    }
    rep(i,count) cout << ans[i] << " ";

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

int main(){
int n,x;
cin>>n>>x;
int a[n];
for(int i=0;i<n;i++){
    cin>>a[i];
}
for(int i=0;i<n;i++){
    if(a[i]!=x)
    cout<<a[i]<<" ";
}
}