Alice likes snow a lot! Unfortunately, this year's winter is already over, and she can't expect to have any more of it. Bob has thus bought her a gift — a large snow maker. He plans to make some amount of snow every day. On day i he will make a pile of snow of volume Vi and put it in her garden.

Each day, every pile will shrink a little due to melting. More precisely, when the temperature on a given day is Ti, each pile will reduce its volume by Ti. If this would reduce the volume of a pile to or below zero, it disappears forever. All snow piles are independent of each other. 

Note that the pile made on day i already loses part of its volume on the same day. In an extreme case, this may mean that there are no piles left at the end of a particular day.

You are given the initial pile sizes and the temperature on each day. Determine the total volume of snow melted on each day. 

Input

The first line contains a single integer N (1 ≤ N ≤ 105) — the number of days. 

The second line contains N integers V1, V2, ..., VN (0 ≤ Vi ≤ 109), where Vi is the initial size of a snow pile made on the day i.

The third line contains N integers T1, T2, ..., TN (0 ≤ Ti ≤ 109), where Ti is the temperature on the day i.

Output

Output a single line with N integers, where the i-th integer represents the total volume of snow melted on day i.

Examples

Input

3
10 10 5
5 7 2


Output

5 12 4


Input

5
30 25 20 15 10
9 10 12 4 13


Output

9 20 35 11 25

Note

In the first sample, Bob first makes a snow pile of volume 10, which melts to the size of 5 on the same day. On the second day, he makes another pile of size 10. Since it is a bit warmer than the day before, the first pile disappears completely while the second pile shrinks to 3. At the end of the second day, he has only a single pile of size 3. On the third day he makes a smaller pile than usual, but as the temperature dropped too, both piles survive till the end of the day.
#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
struct SegmentTree {
  int S, H;
  T zero;
  vector<T> value;
  U noop;
  vector<bool> dirty;
  vector<U> prop;
  SegmentTree<T, U>(int _S, T _zero = T(), U _noop = U()) {
    zero = _zero, noop = _noop;
    for (S = 1, H = 1; S < _S;) S *= 2, H++;
    value.resize(2 * S, zero);
    dirty.resize(2 * S, false);
    prop.resize(2 * S, noop);
  }
  void init(vector<T> &leaves) {
    copy(leaves.begin(), leaves.end(), value.begin() + S);
    for (int i = S - 1; i > 0; i--) value[i] = value[2 * i] + value[2 * i + 1];
  }
  void apply(int i, U &update) {
    value[i] = update(value[i]);
    if (i < S) {
      prop[i] = prop[i] + update;
      dirty[i] = true;
    }
  }
  void rebuild(int i) {
    for (int l = i / 2; l; l /= 2) {
      T combined = value[2 * l] + value[2 * l + 1];
      value[l] = prop[l](combined);
    }
  }
  void propagate(int i) {
    for (int h = H; h > 0; h--) {
      int l = i >> h;
      if (dirty[l]) {
        apply(2 * l, prop[l]);
        apply(2 * l + 1, prop[l]);
        prop[l] = noop;
        dirty[l] = false;
      }
    }
  }
  void upd(int i, int j, U update) {
    i += S, j += S;
    propagate(i), propagate(j);
    for (int l = i, r = j; l <= r; l /= 2, r /= 2) {
      if ((l & 1) == 1) apply(l++, update);
      if ((r & 1) == 0) apply(r--, update);
    }
    rebuild(i), rebuild(j);
  }
  T query(int i, int j) {
    i += S, j += S;
    propagate(i), propagate(j);
    T res_left = zero, res_right = zero;
    for (; i <= j; i /= 2, j /= 2) {
      if ((i & 1) == 1) res_left = res_left + value[i++];
      if ((j & 1) == 0) res_right = value[j--] + res_right;
    }
    return res_left + res_right;
  }
};
struct node {
  long long int sum, width;
  node operator+(const node &n) {
    node tmp;
    tmp.sum = sum + n.sum;
    tmp.width = width + n.width;
    return tmp;
  }
};
struct update {
  bool type;
  long long int value;
  node operator()(const node &n) {
    node tmp;
    if (type) {
      tmp.sum = n.width * value;
      tmp.width = n.width;
    } else {
      tmp.sum = n.sum + n.width * value;
      tmp.width = n.width;
    }
    return tmp;
  }
  update operator+(const update &u) {
    update tmp;
    if (u.type) return u;
    tmp.type = type;
    tmp.value = value + u.value;
    return tmp;
  }
};
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<long long> value(n), temp(n), sum(n), result(n, 0);
  for (auto &x : value) cin >> x;
  for (auto &x : temp) cin >> x;
  long long tt = 0;
  for (int i = 0; i < n; i++) {
    sum[i] = temp[i] + tt;
    tt = sum[i];
  }
  SegmentTree<node, update> st(n);
  vector<node> leaves(n, {0, 1});
  st.init(leaves);
  tt = 0;
  for (int i = 0; i < n; i++) {
    int j =
        upper_bound(sum.begin(), sum.end(), value[i] + tt) - sum.begin() - 1;
    update u{false, 1};
    if (i <= j) {
      st.upd(i, j, u);
    }
    if (j < n - 1 && i <= j) {
      long long temp = value[i] - (sum[j] - tt);
      result[j + 1] += max(0ll, temp);
    } else if (j < i)
      result[i] += value[i];
    tt = sum[i];
  }
  for (int i = 0; i < n; i++) {
    cout << st.query(i, i).sum * temp[i] + result[i] << endl;
  }
}
