import Control.Applicative

main = do (n:m:l) <- map read . words <$> getLine
          abs <- map (map read . words) . lines <$> getContents
          let as = fst $ splitAt n abs
          let bs = snd $ splitAt n abs
          putStr . unlines . map (unwords . map show) $ solve as bs

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

makeRow :: [[Int]] -> [Int] -> [Int]
makeRow bs a = map (dot a) $ tra bs

dot :: [Int] -> [Int] -> Int
dot a b = sum $ zipWith (*) a b

tra :: [[Int]] -> [[Int]]
tra ([]:_) = []
tra bs = (map head bs) : (tra $ map tail bs)