#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i64 i=0; i<n; i++)
#define all(v) v.begin(),v.end()
#define pp pair<int,int>
using Graph=vector<vector<int>>;
using i64=int64_t;

int main() {
    int n,m;cin>>n>>m;
    rep(i,m) {
        string s;
        cin>>s;
    }
    rep(i,20) {
        rep(j,20) {
            cout << "H";
        }
        cout << endl;
    }
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define rep(i,n) for(ll i=0; i<(n);++i)
#define pb push_back
template<typename T> int max_index(vector<T>& v){auto mi = max_element(v.begin(), v.end()); return distance(v.begin(), mi);}
template<typename T> ll max_value(vector<T>& v){auto mi = max_element(v.begin(),v.end()); return (*mi);}

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> 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 amax = 0;
    for(int i = 0; i < n; i++){
        amax = max(amax, a[i]);
        if(ans < amax*b[i])
            ans = amax*b[i];
        cout << ans << endl;
    }

    return 0;
}