import Control.Monad
import Control.Applicative

mul xs as = map (sum . zipWith (*) as) xs

main = do
  [n, m] <- map (\x -> read x :: Int) . words <$> getLine
  a <- replicateM n $ map (\x -> read x :: Int) . words <$> getLine
  b <- replicateM m readLn
  mapM_ print $ mul a b