gg=[]
bb=[]
n,m=gets.split(" ").map{|v|v=v.to_i}
1.upto(n){|a|
  g=gets.split(" ").map{|v|v=v.to_i}
  gg.push(g)
}
1.upto(m){|c|
  b=gets.to_i
  bb.push(b)
}
sum=[]
0.upto(n-1){|d|
  s=[]
  0.upto(m-1){|e|
    s.push(gg[d][e]*bb[e])
  }
sum.push(s.inject(:+))
}
puts sum
    