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

A = []

b = []

for i in range(n):

    A.append([int(j) for j in input().split()])

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()))

A =[[int(i) for i in input().split()] for j in range(n)]

b = []

for i in range(m):

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

ans = [0 for i in range(n)]

for i in range(n):

    for j in range(m):

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

for i in ans:

    print(i)
n, m = list(map(int, input().split()))
A = []
b = []
for i in range(n):
    A.append([int(j) for j in input().split()])
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()))
A = [[int(i) for i in input().split()] for j in range(n)]
b = []
for i in range(m):
    b.append(int(eval(input())))
ans = [0 for i in range(n)]
for i in range(n):
    for j in range(m):
        ans[i] += A[i][j] * b[j]
for i in ans:
    print(i)

-A = [] +A = [[int(i) for i in input().split()] for j in range(n)] -for i in range(n): -    A.append([int(j) for j in input().split()]) +ans = [0 for i in range(n)] -    sum = 0 -        sum += A[i][j] * b[j] -    print(sum) +        ans[i] += A[i][j] * b[j] +for i in ans: +    print(i)