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 *V*<sub class="lower-index">*i*</sub> 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 *T*<sub class="lower-index">*i*</sub>, each pile will reduce its volume by *T*<sub class="lower-index">*i*</sub>. 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.
The first line contains a single integer *N* (1 ≤ *N* ≤ 10<sup class="upper-index">5</sup>) — the number of days. 

The second line contains *N* integers *V*<sub class="lower-index">1</sub>, *V*<sub class="lower-index">2</sub>, ..., *V*<sub class="lower-index">*N*</sub> (0 ≤ *V*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>), where *V*<sub class="lower-index">*i*</sub> is the initial size of a snow pile made on the day *i*.

The third line contains *N* integers *T*<sub class="lower-index">1</sub>, *T*<sub class="lower-index">2</sub>, ..., *T*<sub class="lower-index">*N*</sub> (0 ≤ *T*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>), where *T*<sub class="lower-index">*i*</sub> is the temperature on the day *i*.
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.
3
10 10 5
5 7 2
5 12 4
5
30 25 20 15 10
9 10 12 4 13
9 20 35 11 25
4
0 0 0 0
1 2 3 4
0 0 0 0
10
11 39 16 34 25 3 12 11 31 16
10 0 4 9 8 9 7 8 9 2
10 0 9 27 27 30 28 17 12 4
10
20 35 4 0 6 29 4 9 17 10
0 9 4 7 5 1 4 3 9 4
0 18 12 14 10 3 12 9 26 12
1
4
5
4
1
5
4
4
1
5
5
5
2
9 3
8 2
8 3
2
9 3
4 4
4 7
2
9 3
10 2
9 2
13
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
"""
usefull snippets:
    - map(int, input().split())
    - map(int, sys.stdin.readline().split()))
    - int(input())
    - int(sys.stdin.readline().strip())
    - sys.stdout.write()
    - sys.stdout.write(" ".join(map(str, c) # writes c - collection of ints
"""
# import collections
import sys
from bisect import bisect_left
from collections import deque
from math import gcd
from collections import defaultdict


# recursion increase
# sys.setrecursionlimit(10000)

# number with big precision
# from decimal
# getcontext().prec = 10_000


# input parser
# n, d, li, ld, ls, s - int, float, list of ints, list of floats, list of string, string
# lists are lines with ' '(space) delimiters
def get_from_input(format: str, wrap_lists=True):
    result = []
    selected_types = format.split()
    for type in selected_types:
        input = sys.stdin.readline().strip()
        if type == 'n':
            result.append(int(input))
        elif type == 'd':
            result.append(float(input))
        elif type == 's':
            result.append(input)
        elif type == 'li':
            mapped = map(int, input.split())
            result.append(list(mapped) if wrap_lists else mapped)
        elif type == 'ld':
            mapped = map(float, input.split())
            result.append(list(mapped) if wrap_lists else mapped)
        elif type == 'ls':
            result.append(list(input.split()))

    if len(result) == 1:
        return result[0]
    return result


# splits aaasfffsga into (aaa, s, fff, s, g, a) blocks with signature (startPos, length, type)
def split_into_blocks(s):
    blocks = []

    i = 0
    curr_type = s[0]
    curr_len = 0
    while i < len(s):
        if s[i] == curr_type:
            curr_len += 1
            i += 1
        else:
            blocks.append((i - curr_len, curr_len, curr_type))
            curr_type = s[i]
            curr_len = 0

    blocks.append((i - curr_len, curr_len, curr_type))

    return blocks


# longest common prefix
def get_lcp(s, suffix_array):
    s = s + "$"
    n = len(s)
    lcp = [0] * (n)
    pos = [0] * (n)
    for i in range(n - 1):
        pos[suffix_array[i]] = i
    k = 0
    for i in range(n - 1):
        if k > 0:
            k -= 1
        if pos[i] == n - 1:
            lcp[n - 1] = -1
            k = 0
            continue
        else:
            j = suffix_array[pos[i] + 1]
            while max([i + k, j + k]) < n and s[i + k] == s[j + k]:
                k += 1
            lcp[pos[i]] = k

    return lcp


def get_suffix_array(word):
    suffix_array = [("", len(word))]

    for position in range(len(word)):
        sliced = word[len(word) - position - 1:]
        suffix_array.append((sliced, len(word) - position - 1))

    suffix_array.sort(key=lambda x: x[0])
    return [item[1] for item in suffix_array]


def get_ints():
    return map(int, sys.stdin.readline().strip().split())


def bin_search(collection, element):
    i = bisect_left(collection, element)
    if i != len(collection) and collection[i] == element:
        return i
    else:
        return -1


def bp(a, aim):
    l = -1
    r = len(a)
    while l < r - 1:
        m = (l + r) // 2
        if a[m] < aim:
            l = m
        else:
            r = m

    return r


def main():
    n = int(input())
    v = get_from_input('li')
    t = get_from_input('li')

    pref = []
    s = 0
    for i in range(n):
        s += t[i]
        pref.append(s)

    r = [0]*n
    ans = [0]*n
    for i in range(n):
        if i == 0:
            curr = v[i]
        else:
            curr = v[i] + pref[i - 1]

        rj = bp(pref, curr)
        if rj >= n:
            ans[n - 1] += t[n - 1]
        else:
            ans[rj] += t[rj] - (pref[rj] - curr)
            r[rj] += 1

    curr = 0
    for i in range(n):
        if i == n - 1:
            print(ans[n - 1])
            break
        curr += 1 - r[i]
        ans[i] += t[i] * curr
        print(ans[i], end=' ')


if __name__ == "__main__":
    main()
