import Control.Monad

matrixDotVector :: [[Int]] -> [Int] -> [Int]
matrixDotVector m v = map (f v) m
  where
    f :: [Int] -> [Int] -> Int
    f vec1 vec2 = sum $ zipWith (*) vec1 vec2

main = do
  [n,m] <- fmap (map read . words) getLine
  matrix <- replicateM n $ fmap (map read . words) getLine :: IO [[Int]]
  vector <- replicateM m $ fmap read getLine :: IO [Int]


  -- print matrix
  -- print vector
  -- print $ matrixDotVector matrix vector
  forM_ (matrixDotVector matrix vector) $ \i -> do
    print i
