size = STDIN.gets
size_l = size.split(" ")[0].to_i
size_r = size.split(" ")[1].to_i
line = "########################"

def calc(matrix, vector)
  answer = []
  for i in 0..matrix.length - 1 do
    line = matrix[i]
    sum = 0
    for j in 0..line.length - 1 do
      sum += line[j] * vector[j]
    end
    answer << sum
  end
  return answer
end

# get matrix
# puts line
matrix = []
for i in 1..size_l do
  line = STDIN.gets.split(" ")
  num_line = []
  for j in 0..line.length - 1 do
    num = line[j].to_i
    num_line << num
  end
  matrix << num_line
end

# print matrix

# get vector
vector = []
for i in 1..size_r do
  num = gets.to_i
  vector << num
end

# print vector

answer = calc(matrix, vector)
puts answer