require "matrix"
#  m*nの行列
m,n=gets.chomp.split(" ").map(&:to_i);
$mat=Array.new(m)
for i in 0..m-1 do
 $mat[i]=gets.chomp.split(" ").map(&:to_i)
end
$vec=Array.new(n)
for i in 0..n-1 do
 $vec[i]=gets.to_i
end
for i in 0..m-1 do
 sum=0
 for j in 0..n-1 do
 sum=sum+$mat[i][j]*$vec[j]
 end
 print("#{sum}\n")
end
