let split str delim =
  let rec doit s acc =
    match
      try Some (String.index s delim)
      with _ -> None
    with
    | None -> s :: acc
    | Some i ->
        let s1 = String.sub s 0 i in
        let s2 = String.sub s (i + 1) (String.length s - String.length s1 - 1) in
        doit s2 (s1 :: acc)
  in
  List.rev (doit str [])

let () =
  let l = read_line () in
  match List.map int_of_string (split l ' ') with
  | [] | [_] | _::_::[] -> exit 1
  | n :: m :: l :: _ ->
      let a = Array.make_matrix n m 0 in
      let b = Array.make_matrix m l 0 in
      for i = 1 to n do
        let row = read_line () in
        let row = Array.of_list (List.map int_of_string (split row ' ')) in
        for j = 1 to m do
          a.(i-1).(j-1) <- row.(j-1)
        done;
      done;
      for i = 1 to m do
        let row = read_line () in
        let row = Array.of_list (List.map int_of_string (split row ' ')) in
        for j = 1 to l do
          b.(i-1).(j-1) <- row.(j-1)
        done;
      done;
      for i = 1 to n do
        for j = 1 to l do
          let c = ref 0 in
          for k = 1 to m do
            c := !c + a.(i-1).(k-1) * b.(k-1).(j-1)
          done;
          if j = 1 then Printf.printf "%d" !c
          else Printf.printf " %d" !c
        done;
        print_newline ();
      done