import Control.Monad
import Control.Applicative

main = do
	[n, m] <- (map read . words) <$> getLine
	a <- replicateM n $ (map read . words) <$> getLine
	b <- replicateM m $ read <$> getLine
	mapM_ print $ map sum $ map (zipWith (*) b) a 