r, c = ARGF.gets.split.map(&:to_i)

arr= []
r.times do |i|
  arr << ARGF.gets.split.map(&:to_i)
end

vec = []
c.times do |i|
  vec << ARGF.gets.to_i
end

r.times do |i|
  sum = 0
  c.times do |j|
    sum += arr[i][j] * vec[j]
  end
  puts sum
end