import Control.Applicative
import Control.Monad

solve :: Int -> Int -> Int -> [[Int]] -> [[Int]] -> [[Int]]
solve n m l matrix1 matrix2 = map (\r -> map (\c -> element r c) [0 .. l - 1]) [0 .. n - 1]
    where
        element r c = foldl (\a (x, y) -> a + x * y) 0 $ zip (row r) (column c)
        row r       = matrix1 !! r
        column c    = map (\r -> matrix2 !! r !! c) [0 .. m - 1]

main :: IO ()
main = do
    [n, m, l] <- map read . words <$> getLine
    matrix1   <- map (map read . words) <$> replicateM n getLine
    matrix2   <- map (map read . words) <$> replicateM m getLine
    putStr $ unlines $ map (unwords . map show) $ solve n m l matrix1 matrix2