/*
	Auth: Loxilante
	Time: 2020/11/15
	Prog: A
	Lang: cpp
*/
#include <bits/extc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define ms(n, t) memset(n, t, sizeof(n))
#define pb push_back
#define int ll
#ifndef JOEON
#define D(...) 97
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
template<typename tn = int> inline tn next(void) { tn k; cin>>k; return k; }
signed main(void)
{
	clock_t Begin = clock();

	#ifdef JOEON
//		freopen("C:\\Users\\Joeon\\Desktop\\IN.txt", "r", stdin);
//		freopen("C:\\Users\\Joeon\\Desktop\\OUT.txt", "w", stdout);
	#endif
	
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n = next();
	cout<<(n < 0 ? 0 : n)<<endl;
	
	clock_t End = clock();
	
	D((double)(End-Begin)/CLOCKS_PER_SEC);
	
	return 0;
}
/*

 */
/**
 *    author:  Anchord
 *    created: 15.01.2021       
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long N; cin >> N;
  long long A[N], B[N];
  for(int i = 0; i < N; ++i){
   cin >> A[i];
  }
  for(int i = 0; i < N; ++i){
   cin >> B[i];
  }                    
  long long ans = 0, m = 0;
  for(int i = 0; i < N; ++i){
   m = max(m, A[i]);
   ans = max(ans, m*B[i]); 
   cout << ans << '\n';
  }
  return 0;
} 
 