#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

static const int IINF = (1LL << 31) - 1;

int main() {
    ll n, x, a;
    cin >> n >> x;
    vector<ll> ans;
    rep(i, n) {
        cin >> a;
        if(a != x) ans.push_back(a);
    }
    rep(i, ans.size()) {
        if(i) cout << " ";
        cout << ans[i];
    }
    cout << endl;
}
#include <iostream>

using namespace std;

int n;
long long a[300000],b[300000];
long long maxa=-9999,maxx=-9999;
int main()
{
    int i,j,k;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(i=1;i<=n;i++)
    {
        maxa=max(a[i],maxa);
        cin>>b[i];
        maxx=max(maxx,maxa*b[i]);
        cout<<maxx<<endl;
    }
    return 0;
}
