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

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

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

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

for i in range(n):

    for j in range(m):

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



for i in range(n):

    print((c[i]))

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

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

b = []

for i in range(m):

    e = int(eval(input()))

    b.append(e)

for i in range(n):

    p = 0

    for j in range(m):

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

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

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

-a = [[int(i) for i in input().split()] for j in range(n)] -b = [int(eval(input())) for i in range(m)] -c = [0 for i in range(n)] +A = [[int(e) for e in input().split()] for i in range(n)] +b = [] +for i in range(m): +    e = int(eval(input())) +    b.append(e) +    p = 0 -        c[i] += a[i][j] * b[j] -for i in range(n): -    print((c[i])) +        p += A[i][j] * b[j] +    print(p)