#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define F first
#define S second
#define um map <ll,ll>
#define rep(i,z,n)  for(int i=z;i<n;i++)
#define repi(i,z,n) for(int i=z;i<=n;i++)
#define repn(i,z,n) for(int i=n-1;i>=z;i--)
#define vec vector<ll>
#define vecp vector<pair<ll,ll>>
#define pi (double)3.14159265358979323846
#define ld long double
#define all(z) z.begin(),z.end()

ll power(ll a, ll b, ll m) { ll ans = 1; a = a % m; if (a == 0) return 0; while (b) { if (b & 1) ans = (ans * a) % m; b /= 2; a = (a * a) % m; } return ans; }
ll modInverse(ll a, ll m) {return power(a, m - 2, m);}
ll binpow(ll a, ll b) {ll res = 1; while (b > 0) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll binlog2(ll n) {ll logValue = -1; while (n) {logValue++; n >>= 1;} return logValue;}
ll ceil(ll t1, ll t2) {ll ans = (t1 + t2 - 1) / t2; return ans;}
void print(vec a) {rep(i, 0, a.size())cout << a[i] << " "; cout << endl;}
const ll mod = 1e9 + 7;
const ll N = 1e5 + 5;
const ll inf = 2e18;


void solve() {
    ll n, x;
    cin >> n >> x;
    vec a(n);
    rep(i, 0, n)
    cin >> a[i];

    rep(i, 0, n) {
        if (a[i] == x)
            continue;

        cout << a[i] << " ";
    }

    cout << endl;
}


int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    speed;
    int test = 1;
    // init();
    // cin >> test;
    // ll t1 = 1;

    while (test--) {
        // cout << "Case #" << t1 << ": ";
        solve();
        // t1++;
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ff                first
#define brn                "\n"
#define ss                second
#define mk                make_pair
#define int               long long
#define pb                push_back
#define ps(x,y)           fixed<<setprecision(y)<<x
#define w(x)              int x; cin>>x; while(x--)
#define FOR(i,a,b)        for(int i=(a);i<(b);i++)
#define ROF(i,a,b)        for(int i=(a);i>=(b);i--)
#define so(a,n)           sort(a,a+n)
#define rso(a,n)          sort(a,a+n),reverse(a,a+n)
#define all(v)            (v).begin(),(v).end()
#define ps(x,y)           fixed<<setprecision(y)<<x
#define sz                size();
#define p_sieve           10000007
const int                 maxn = 1e3 + 5;
const int                 modulo = 1000000007;
#define mod               1000000009;
const double              pi = 3.14159;
#define INF               1000001000
#define imx                9999999999999999
#define imi               -9999999999999999
//check n==1 and base cases//

//********************************---------always check array boundness-----------****************
// factorial ncr
// int printNcR(int n, int r)
// {
//     if(n<r)return 0;
//     long long p = 1, k = 1;
//     if (n - r < r)
//         r = n - r;
//     if (r != 0) {
//         while (r) {
//             p *= n;
//             k *= r;
//             long long m = __gcd(p, k);
//             p /= m;
//             k /= m;

//             n--;
//             r--;
//         }
//     }
//     else p = 1;
//     return p;
// }

// int power(int x, unsigned int y)
// {
//     int res = 1;
//     x = x % modulo;
//     if (x == 0) return 0;
//     while (y > 0)
//     {
//         if (y & 1) res = (res*x);
//         y = y>>1;
//         x = (x*x);
//     }
//     return res;
// }

void solve()
{
  int n;cin>>n;
  int a[n],b[n],c[n];
  FOR(i,0,n)cin>>a[i];
  FOR(i,0,n)cin>>b[i];
  int maxi1=a[0];
  int maxi2=a[0]*b[0];
  cout<<maxi2<<'\n';
  FOR(i,1,n)
  {
  	maxi1=max(maxi1,a[i]);
    int tt=max(a[i]*b[i],max(maxi1*b[i],maxi2));
    cout<<tt<<'\n';
    maxi2=max(maxi2,tt);
    
    
  }
  	
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	//prime_sieve();
	//w(t)
	solve();
}