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

A=[[] for _ in range(n)]

for i in range(n):

 A[i] = [_ for _ in map(int,input().split())]

b=[]

for i in range(m):

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

for i in range(n):

 c=0

 for j in range(m):

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

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

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

b=[int(eval(input())) for _ in range(m)]

for i in range(n):

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

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

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