-- Array - Matrix Vector Multiplication

import Control.Applicative

main :: IO ()
main = do
  [n, _] <- map read . words <$> getLine
  (a, b) <- splitAt n . map (map read . words) . lines <$> getContents
  mapM_ (print . (\x -> sum $ zipWith (*) x (concat b))) a

