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



A = [[0 for q in range(m)] for w in range(n)]

B = [0 for e in range(m)]



for i in range(n):

	A[i] = list(map(int, input().split()))

for j in range(m):

	B[j] = int(eval(input()))



for i in range(n):

	c = 0

	for j in range(m):

		c += A[i][j] * B[j]

	print(c)
listA = []

listB = []

Answer = []

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

for i in range(n):

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

for j in range(m):

    listB.append(int(eval(input())))

for k in range(n):

    result = 0

    for l in range(m):

        result += listA[k][l]*listB[l]

    Answer.append(result)

for p in range(n):

    print((Answer[p]))

n, m = list(map(int, input().split()))
A = [[0 for q in range(m)] for w in range(n)]
B = [0 for e in range(m)]
for i in range(n):
    A[i] = list(map(int, input().split()))
for j in range(m):
    B[j] = int(eval(input()))
for i in range(n):
    c = 0
    for j in range(m):
        c += A[i][j] * B[j]
    print(c)

listA = []
listB = []
Answer = []
n, m = list(map(int, input().split()))
for i in range(n):
    listA.append(list(map(int, input().split())))
for j in range(m):
    listB.append(int(eval(input())))
for k in range(n):
    result = 0
    for l in range(m):
        result += listA[k][l] * listB[l]
    Answer.append(result)
for p in range(n):
    print((Answer[p]))

+listA = [] +listB = [] +Answer = [] -A = [[0 for q in range(m)] for w in range(n)] -B = [0 for e in range(m)] -    A[i] = list(map(int, input().split())) +    listA.append(list(map(int, input().split()))) -    B[j] = int(eval(input())) -for i in range(n): -    c = 0 -    for j in range(m): -        c += A[i][j] * B[j] -    print(c) +    listB.append(int(eval(input()))) +for k in range(n): +    result = 0 +    for l in range(m): +        result += listA[k][l] * listB[l] +    Answer.append(result) +for p in range(n): +    print((Answer[p]))