n, m = gets.split.map(&:to_i)
arr = Array.new
arr2 = Array.new
n.times do
    arr.push(gets.split.map(&:to_i))
end
m.times do
    arr2.push(gets.to_i)
end
n.times do |i|
    sum = 0
    m.times do |j|
        sum += arr[i][j] * arr2[j]
    end
    p sum
end