import Control.Applicative

main = do [n,m] <- (map read) . words <$> getLine
          vecs <- map (map read) . (map words) . lines <$> getContents
          let as = take n vecs
          let bs = concat $ drop n vecs
          putStr . unlines . map show $ solve as bs

solve :: [[Int]] -> [Int] -> [Int]
solve as bs = map (innerProduct bs) as

innerProduct :: [Int] -> [Int] -> Int
innerProduct xs ys = sum $ zipWith (*) xs ys
          