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>
struct SegmentTree {
  struct Node {
    long long delta, min, max;
    long long rl, rr;
    Node *left, *right;
    bool needs_children;
    Node(const long long& rangeL, const long long& rangeR) {
      rl = rangeL;
      rr = rangeR;
      min = max = delta = 0;
      needs_children = rl != rr;
      left = right = nullptr;
    }
    ~Node(void) {
      if (left != nullptr) delete left;
      if (right != nullptr) delete right;
    }
    void assert_children(void) {
      if (!needs_children) return;
      long long mid = (rr + rl) / 2;
      left = new Node(rl, mid);
      right = new Node(mid + 1, rr);
      needs_children = false;
    }
    long long min_val(void) const { return delta + min; }
    long long max_val(void) const { return delta + max; }
    void prop(void) {
      assert_children();
      if (delta != 0) {
        min += delta;
        max += delta;
        if (left != nullptr) left->delta += delta;
        if (right != nullptr) right->delta += delta;
        delta = 0;
      }
    }
    void update(const long long& l, const long long& r, const long long& val) {
      prop();
      if (l == rl && r == rr)
        delta += val;
      else {
        long long mid = (rr + rl) / 2;
        if (l <= mid) left->update(l, std::min(mid, r), val);
        if (r > mid) right->update(std::max(mid + 1, l), r, val);
        if (left != nullptr && right != nullptr) {
          min = std::min(left->min_val(), right->min_val());
          max = std::max(left->max_val(), right->max_val());
        }
      }
    }
    std::pair<long long, long long> query(const long long& l,
                                          const long long& r) {
      prop();
      std::pair<long long, long long> ret;
      if (l == rl && r == rr)
        return {min_val(), max_val()};
      else {
        long long min = std::numeric_limits<long long>::max();
        long long max = std::numeric_limits<long long>::min();
        long long mid = (rr + rl) / 2;
        if (l <= mid) {
          auto temp = left->query(l, std::min(mid, r));
          min = std::min(min, temp.first);
          max = std::max(max, temp.second);
        }
        if (r > mid) {
          auto temp = right->query(std::max(mid + 1, l), r);
          min = std::min(min, temp.first);
          max = std::max(max, temp.second);
        }
        ret = {min, max};
      }
      return ret;
    }
  };
  long long size;
  Node* root;
  SegmentTree(const long long& n) {
    size = n;
    root = new Node(0, n - 1);
  }
  ~SegmentTree(void) { delete root; }
  void update(const long long& left, const long long& right,
              const long long& delta) {
    root->update(left, right, delta);
  }
  std::pair<long long, long long> query(const long long& left,
                                        const long long& right) {
    return root->query(left, right);
  }
};
struct bg_data {
  long long val, idx;
  bool operator<(const bg_data& o) const {
    return val < o.val || val == o.val && idx < o.idx;
  }
};
int main(void) {
  long long n;
  std::scanf("%lld", &n);
  SegmentTree kms(n);
  std::set<bg_data> points;
  std::vector<long long> snow(n), melt(n + 1);
  for (auto& e : snow) std::scanf("%lld", &e);
  for (long long i = 1; i <= n; ++i) {
    std::scanf("%lld", &melt[i]);
    melt[i] += melt[i - 1];
    points.insert({melt[i], i - 1});
  }
  std::vector<long long> special(n);
  for (long long i = 0; i < n; ++i) {
    long long goal = snow[i] + melt[i];
    auto it = points.lower_bound({goal, i});
    long long end;
    if (it == points.end()) {
      end = n - 1;
    } else {
      end = it->idx;
      special[it->idx] += goal - it->val;
    }
    kms.update(i, end, 1);
  }
  for (long long i = 0; i < n; ++i) {
    std::printf("%lld ",
                special[i] + (melt[i + 1] - melt[i]) * kms.query(i, i).first);
  }
  std::puts("");
  return 0;
}
