import Control.Applicative
import Data.List (transpose)

main :: IO ()
main = do
  [n, _, _] <- map read . words <$> getLine
  (a, b) <- splitAt n . map (map read . words) . lines <$> getContents
  mapM_ (putStrLn . unwords . map show) $ a |*| b

--
-- Vector * Vector (inner product)
--
type Vector a = [a]

(/*/) :: Num a => Vector a -> Vector a -> a
(/*/) xs ys = sum $ zipWith (*) xs ys
infixl 7 /*/

--
-- Matrix * Matrix
--
type Matrix a = [Vector a]

(|*|) :: Num a => Matrix a -> Matrix a -> Matrix a
(|*|) xss yss = [[xs /*/ ys | ys <- yss'] | xs <- xss]
    where yss' = transpose yss
infixl 7 |*|

