n, m = gets.split( " " ).map { | val | val.to_i }
ai = Array.new( n )
ai.each_index { |i|
	ai[i] = gets.split( " " ).map { | val | val.to_i }
}
bi = Array.new( m )
bi.each_index { |i|
	bi[i] = gets.to_i
}

ai.each_index { |i|
	c = 0
	ai[i].each_index { |j|
		c += ( ai[i][j] * bi[j] )
	}
	puts( c )
}