transpose :: [[Int]] -> [[Int]]
transpose ([]:_) = []
transpose m = (map head m):(transpose (map tail m))

calcCi :: [Int] -> [[Int]] -> [Int]
calcCi _ [] = []
calcCi x (y:ys) = (sumProduct x y):(calcCi x ys)
  where
      sumProduct :: [Int] -> [Int] -> Int
      sumProduct x y = sum $ zipWith (*) x y

mulAB :: [[Int]] -> [[Int]] -> [[Int]]
mulAB [] _ = []
mulAB (x:xs) y = (calcCi x yt):(mulAB xs y)
  where
      yt = transpose y

readMatrix :: Int -> Int -> IO [[Int]]
readMatrix 0 c = return []
readMatrix r c = do
    rows  <- getLine >>= return.(map $ \n -> read n :: Int).words
    rests <- readMatrix (r-1) c
    return $ rows:rests

printMatrix :: [[Int]] -> IO ()
printMatrix = mapM_ (\nums -> putStrLn $ unwords [show n | n <- nums])

main :: IO ()
main = do
    [n,m,l] <- getLine >>= return.(map $ \n -> read n :: Int).words
    a <- readMatrix n m
    b <- readMatrix m l
    printMatrix $ mulAB a b

