n, m = STDIN.gets.split(' ').map(&:to_i)

mat = []
n.times do |i|
  mat << STDIN.gets.split(' ').map(&:to_i)
end

vec = []
m.times do |j|
  vec << STDIN.gets.to_i
end

n.times do |i|
  sum = 0
  m.times do |j|
    sum += mat[i][j] * vec[j]
  end
  puts sum
end