n,m = list(map(int, input().split()))



# init

A = []

b = []

for _ in range(n):

    A.append(list(map(int, input().split())))

for _ in range(m):

    b.append(int(eval(input())))





for row in range(n):

    p = 0

    for i, j in zip(A[row], b):

        p += i * j

    print(p)
n, m = list(map(int, input().split()))



A = []

for i in range(n):

    A.append(list(map(int, input().split())))

b = []

for i in range(m):

    b.append(int(eval(input())))



for i in range(n):

    sum = 0

    for j in range(m):

        sum += A[i][j] * b[j]

    print(sum)



n, m = list(map(int, input().split()))
# init
A = []
b = []
for _ in range(n):
    A.append(list(map(int, input().split())))
for _ in range(m):
    b.append(int(eval(input())))
for row in range(n):
    p = 0
    for i, j in zip(A[row], b):
        p += i * j
    print(p)

n, m = list(map(int, input().split()))
A = []
for i in range(n):
    A.append(list(map(int, input().split())))
b = []
for i in range(m):
    b.append(int(eval(input())))
for i in range(n):
    sum = 0
    for j in range(m):
        sum += A[i][j] * b[j]
    print(sum)

-# init +for i in range(n): +    A.append(list(map(int, input().split()))) -for _ in range(n): -    A.append(list(map(int, input().split()))) -for _ in range(m): +for i in range(m): -for row in range(n): -    p = 0 -    for i, j in zip(A[row], b): -        p += i * j -    print(p) +for i in range(n): +    sum = 0 +    for j in range(m): +        sum += A[i][j] * b[j] +    print(sum)