n,m = gets.split.map(&:to_i)
mtr = Array.new(n){Array.new(m)}
n.times do |i|
        mtr[i] = gets.split.map(&:to_i)
end

b = Array.new(m)
c = Array.new(n,0)

m.times do |i|
 b[i] = gets.to_i
end

n.times do |i|
    m.times do |j|
      c[i] += mtr[i][j]*b[j]
    end
end
n.times do |i|
    puts "#{c[i]}"
end

