n, m = gets.chomp.split(" ").map(&:to_i)

a = Array.new
for i in 1..n
    a << gets.chomp.split(" ").map(&:to_i)
end

b = Array.new
for i in 1..m
    b << gets.to_i
end

for i in 0..n - 1
    value = 0
    for j in 0..m - 1
        value += (a[i][j] * b[j])
    end
    puts value
end
