n,m = gets.split(" ").map(&:to_i)
matrix = Array.new(n).map{Array.new(m)}
vec = Array.new(m)
c = Array.new(n,0)

for i in 0..(n-1)
    matrix[i] = gets.split(" ").map(&:to_i)
end
for j in 0..(m-1)
    vec[j] = gets.to_i
end

for i in 0..(n-1)
    for j in 0..(m-1)
        c[i] += matrix[i][j] * vec[j]
    end
end

c.each do |ci|
    puts ci
end