#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=200005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;cin>>N;
    vector<ll> A(N),B(N);
    for(int i=0;i<N;i++) cin>>A[i];
    for(int i=0;i<N;i++) cin>>B[i];
    
    ll ans=0;
    
    ll ma=0;
    
    for(int i=0;i<N;i++){
        chmax(ma,A[i]);
        chmax(ans,ma*B[i]);
        cout<<ans<<"\n";
    }
}

#include <bits/stdc++.h>
#define FOR(i, a, n) for (int i = a; i < n; i++)
#define REP(w, n) FOR(w, 0, n)
using namespace std;
typedef long long ll;

int main()
{
	int n;
	cin >> n;
	vector<ll> a(n + 1);
	a[0] = 0;
	vector<ll> b(n + 1);
	REP(i, n)
	{
		ll tmp;
		cin >> tmp;
		a[i + 1] = max(tmp, a[i]);
	}
	b[0] = 0;
	REP(i, n)
	{
		cin >> b[i + 1];
	}
	ll ans = 0;
	FOR(i, 1, n + 1)
	{
		ans = max(ans, a[i] * b[i]);
		cout << ans << endl;
	}
	return (0);
}
