n, m = map(int, input().split())
A = []
b = []
for _ in range(n):
    A.append(list(map(int, input().split())))
for _ in range(m):
    b.append(int(input()))

c = []
for Ai in A:
    c.append(sum(Ai[j] * b[j] for j in range(m)))

for ci in c:
    print(ci)
