let words str =
  let len = String.length str in
  let buf = Buffer.create 128 in
  let rec aux i l =
    if i >= len then List.rev ((int_of_string (Buffer.contents buf))::l)
    else 
      match str.[i] with
      | ' ' ->
        let s = int_of_string (Buffer.contents buf) in
        Buffer.clear buf;
        aux (i+1) (s :: l)
      | c   ->
        Buffer.add_char buf c;
        aux (i+1) l
  in aux 0 []

let transpose matrix =
  List.fold_left
    (fun acc x -> List.map2 (fun a b -> b::a) acc x)
    (Array.make (List.length (List.hd matrix)) [] |> Array.to_list) matrix

let product a b =
  let f m n = List.map
      (fun x -> List.fold_left (+) 0
          (List.map2 (fun a b -> a*b) m x)) n
  in
  List.map (fun x -> f x b) a

  
let () =
  let n,m,l = Scanf.sscanf (read_line ()) "%d %d %d" (fun n m l -> n,m,l) in
  let rec read i =
    let rec iter l = function
      | 0 -> l
      | i ->
        let r = words (read_line ()) in
        iter (r::l) (i-1)
    in iter [] i
  in
  let a = read n |> List.rev in
  let b = read m |> transpose in
  let ab = product a b in
  let sl = List.map (fun x -> String.concat " " (List.map string_of_int x)) ab in
  List.iter print_endline sl