import Control.Applicative
import Control.Monad
import Data.Array
import Data.Array.ST
import Data.List
import qualified Data.Map as M
import qualified Data.Set as S
import Text.Printf

readInts :: IO [Int]
readInts = map read . words <$> getLine

main :: IO ()
main = do
  [n,m] <- readInts
  ass <- replicateM n readInts
  bs <- replicateM m readLn
  forM_ (solve ass bs) $ \c -> do
    print c

solve :: [[Int]] -> [Int] -> [Int] 
solve ass bs = map (sum . zipWith (*) bs) ass

