x = list(map(int, input().split()))
y = list(map(int, input().split()))

res = [0] * (len(x) + len(y) - 1)
for k in range(len(y) - 1, -1, -1):
    tmp = shift(mult_const(x, y[k]), k)
    array_add(res, tmp)

print(' '.join(map(str, res)))