#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i < n; i++) 
#define all(n) n.begin(), n.end()

int main () {
    ll n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> c(n);
    rep(i,n) cin >> a.at(i);
    rep(i,n) cin >> b.at(i);
    ll maxv = a.at(0);
    c.at(0) = a.at(0) * b.at(0);
    for (int i = 1; i < n; i++) {
        maxv = max(maxv, a.at(i));
        c.at(i) = max(c[i - 1], maxv * b.at(i));
    }
    for (auto i : c) {
        cout << i << endl;
    }
}
#include <iostream>
#include <fstream>
#include <string>

using namespace std;
int main()
{
	int N;
	cin>>N;
	int a[N];
	int b[N];
	for(int i=0;i<N;i++){
		cin>>a[i];
		if(i>0){
			if (a[i]<a[i-1]){
				a[i]=a[i-1];
			}
		}
	}
	for(int i=0;i<N;i++){
		cin>>b[i];
	}
	long long int before=0;
	for(int i=0;i<N;i++){
		long long int out=a[i]*b[i];
		if(out<before){
			out=before;
		}else{
			before=out;
		}
		cout<<out<<endl;
	}
return 0;
}

