def mul(a, b, n, m)
  c = []
  for i in 0..(n-1)
    ai = a[i]
    c.push(dot(ai, b, m))
  end
  return c
end

def dot(x, y, m)
  dot_xy_array = []
  dot_xy = 0
  for i in 0..(m-1)
    dot_xy_array.push(x[i] * y[i])
  end
  dot_xy = 0
  dot_xy_array.each do |i|
    dot_xy += i
  end
  return dot_xy
end

input_nm_array = gets.chomp.split.map(&:to_i)
n = input_nm_array[0]
m = input_nm_array[1]
input_a_arrays = []
n.times do
  input_a_array = gets.chomp.split.map(&:to_i)
  input_a_arrays.push(input_a_array)
end
input_b_values = []
m.times do
  input_b_value = gets.chomp.to_i
  input_b_values.push(input_b_value)
end

answer = mul(input_a_arrays, input_b_values, n, m)
for i in 0..(n-1)
  puts answer[i]
end