import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args)
	throws IOException{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	}
	
	static void printArray(long[][] array){
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	}
	
	
	static String getStringlinefromArray(long line[]){
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	}
	
	static int[][] getArrayfromStringlist(ArrayList<String> inputdata){
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	}
	
	static long[][] calcMatrixMultiplication(int[][] array1, int[][] array2){
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	}
	
	static long calcMatrixMultiplicationElement(int[][] array1, int[][] array2,int i,int j) {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	}

}


class TempReaderCall{
	
	static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	}
	
	static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	}
	
	
	static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io import java.util.ArrayList; ArrayList java.util public class Main {

	public static void main(String[] args)
	throws IOException{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	}
	
	static void printArray(long[][] array){
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	}
	
	
	static String getStringlinefromArray(long line[]){
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	}
	
	static int[][] getArrayfromStringlist(ArrayList<String> inputdata){
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	}
	
	static long[][] calcMatrixMultiplication(int[][] array1, int[][] array2){
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	}
	
	static long calcMatrixMultiplicationElement(int[][] array1, int[][] array2,int i,int j) {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	}

} Main public static void main(String[] args)
	throws IOException{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br)); n TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br)) TempReaderCall.splitIntArrayFromString TempReaderCall TempReaderCall.getStdInRead(br) TempReaderCall.getStdInRead TempReaderCall br ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]); input1 TempReaderCall.getStdInReadlines(br, n[0]) TempReaderCall.getStdInReadlines TempReaderCall br n[0] n 0 ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]); input2 TempReaderCall.getStdInReadlines(br, n[1]) TempReaderCall.getStdInReadlines TempReaderCall br n[1] n 1 int[][] array1 array1 array2; array2 long[][] ans; ans array1 = getArrayfromStringlist(input1) array1 getArrayfromStringlist(input1) getArrayfromStringlist input1 array2 = getArrayfromStringlist(input2) array2 getArrayfromStringlist(input2) getArrayfromStringlist input2 ans = calcMatrixMultiplication(array1, array2) ans calcMatrixMultiplication(array1, array2) calcMatrixMultiplication array1 array2 printArray(ans) printArray ans String[] args args static void printArray(long[][] array){
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	} printArray {
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	} for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		} int i=0; int i=0; i 0 i<array.length i array.length array array.length i++ i++ i {
			System.out.println(getStringlinefromArray(array[i]));
		} {
			System.out.println(getStringlinefromArray(array[i]));
		} System.out.println(getStringlinefromArray(array[i])) System.out.println System.out System System.out getStringlinefromArray(array[i]) getStringlinefromArray array[i] array i long[][] array array static String getStringlinefromArray(long line[]){
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	} getStringlinefromArray {
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	} String data = ""; data "" for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " "; int i=0; int i=0; i 0 i<line.length-1 i line.length-1 line.length line line.length 1 i++ i++ i data = data + Long.toString(line[i]) + " "; data = data + Long.toString(line[i]) + " " data data + Long.toString(line[i]) + " " data + Long.toString(line[i]) + " " data Long.toString(line[i]) Long.toString Long line[i] line i " " data = data + line[line.length-1] data data + line[line.length-1] data line[line.length-1] line line.length-1 line.length line line.length 1 return data; data long line[] line static int[][] getArrayfromStringlist(ArrayList<String> inputdata){
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	} getArrayfromStringlist {
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	} int[][] array = new int[inputdata.size()][]; array new int[inputdata.size()][] inputdata.size() inputdata.size inputdata for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		} int i=0; int i=0; i 0 i<inputdata.size() i inputdata.size() inputdata.size inputdata i++ i++ i {
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		} {
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		} array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i)) array[i] array i TempReaderCall.splitIntArrayFromString(inputdata.get(i)) TempReaderCall.splitIntArrayFromString TempReaderCall inputdata.get(i) inputdata.get inputdata i return array; array ArrayList<String> inputdata inputdata static long[][] calcMatrixMultiplication(int[][] array1, int[][] array2){
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	} calcMatrixMultiplication {
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	} long[][] ans = new long[array1.length][]; ans new long[array1.length][] array1.length array1 array1.length for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		} int i = 0; int i = 0; i 0 i < ans.length i ans.length ans ans.length i++ i++ i {
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		} {
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		} ans[i] = new long[array2[0].length] ans[i] ans i new long[array2[0].length] array2[0].length array2[0] array2 0 array2[0].length for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j); int j=0; int j=0; j 0 j<ans[i].length j ans[i].length ans[i] ans i ans[i].length j++ j++ j ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j); ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j) ans[i][j] ans[i] ans i j calcMatrixMultiplicationElement(array1, array2,i,j) calcMatrixMultiplicationElement array1 array2 i j return ans; ans int[][] array1 array1 int[][] array2 array2 static long calcMatrixMultiplicationElement(int[][] array1, int[][] array2,int i,int j) {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	} calcMatrixMultiplicationElement {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	} long ans = 0; ans 0 for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		} int k=0; int k=0; k 0 k < array2.length k array2.length array2 array2.length k++ k++ k {
			ans += array1[i][k] * array2[k][j];
		} {
			ans += array1[i][k] * array2[k][j];
		} ans += array1[i][k] * array2[k][j] ans array1[i][k] * array2[k][j] array1[i][k] array1[i] array1 i k array2[k][j] array2[k] array2 k j return ans; ans int[][] array1 array1 int[][] array2 array2 int i i int j j class TempReaderCall{
	
	static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	}
	
	static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	}
	
	
	static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	}
} TempReaderCall static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	} getStdInReadlines {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	} ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int i = 0; i < line; i++)
			list.add(br.readLine()); int i = 0; int i = 0; i 0 i < line i line i++ i++ i list.add(br.readLine()); list.add(br.readLine()) list.add list br.readLine() br.readLine br return list; list BufferedReader br br int line line static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	} getStdInRead {
		return (br.readLine());
	} return (br.readLine()); (br.readLine()) br.readLine br BufferedReader br br static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	} splitIntArrayFromString {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	} String[] sts = st.split(" "); sts st.split(" ") st.split st " " int[] data = new int[sts.length]; data new int[sts.length] sts.length sts sts.length for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		} int i=0; int i=0; i 0 i<sts.length i sts.length sts sts.length i++ i++ i {
			data[i] = Integer.parseInt(sts[i]);
		} {
			data[i] = Integer.parseInt(sts[i]);
		} data[i] = Integer.parseInt(sts[i]) data[i] data i Integer.parseInt(sts[i]) Integer.parseInt Integer sts[i] sts i return data; data String st st public class Main {

	public static void main(String[] args)
	throws IOException{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	}
	
	static void printArray(long[][] array){
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	}
	
	
	static String getStringlinefromArray(long line[]){
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	}
	
	static int[][] getArrayfromStringlist(ArrayList<String> inputdata){
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	}
	
	static long[][] calcMatrixMultiplication(int[][] array1, int[][] array2){
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	}
	
	static long calcMatrixMultiplicationElement(int[][] array1, int[][] array2,int i,int j) {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	}

} public class Main {

	public static void main(String[] args)
	throws IOException{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	}
	
	static void printArray(long[][] array){
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	}
	
	
	static String getStringlinefromArray(long line[]){
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	}
	
	static int[][] getArrayfromStringlist(ArrayList<String> inputdata){
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	}
	
	static long[][] calcMatrixMultiplication(int[][] array1, int[][] array2){
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	}
	
	static long calcMatrixMultiplicationElement(int[][] array1, int[][] array2,int i,int j) {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args)
	throws IOException{
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int[] n = TempReaderCall.splitIntArrayFromString(TempReaderCall.getStdInRead(br));
		
		ArrayList<String> input1 = TempReaderCall.getStdInReadlines(br, n[0]);
		ArrayList<String> input2 = TempReaderCall.getStdInReadlines(br, n[1]);
		
		int[][] array1, array2;
		long[][] ans;
		array1 = getArrayfromStringlist(input1);
		array2 = getArrayfromStringlist(input2);
		
		ans = calcMatrixMultiplication(array1, array2);
		
		printArray(ans);
	}
	
	static void printArray(long[][] array){
		for(int i=0; i<array.length; i++){
			System.out.println(getStringlinefromArray(array[i]));
		}
	}
	
	
	static String getStringlinefromArray(long line[]){
		String data = "";
		for (int i=0; i<line.length-1; i++)
			data = data + Long.toString(line[i]) + " ";
		
		data = data + line[line.length-1];
		return data;
	}
	
	static int[][] getArrayfromStringlist(ArrayList<String> inputdata){
		int[][] array = new int[inputdata.size()][];
		
		for (int i=0; i<inputdata.size(); i++){
			array[i] = TempReaderCall.splitIntArrayFromString(inputdata.get(i));
		}
		
		return array;
	}
	
	static long[][] calcMatrixMultiplication(int[][] array1, int[][] array2){
		long[][] ans = new long[array1.length][];
		
		for (int i = 0; i < ans.length; i++){
			ans[i] = new long[array2[0].length];
			for (int j=0; j<ans[i].length; j++)
				ans[i][j] = calcMatrixMultiplicationElement(array1, array2,i,j);
		}
		
		return ans;
	}
	
	static long calcMatrixMultiplicationElement(int[][] array1, int[][] array2,int i,int j) {
		long ans = 0;
		for (int k=0; k < array2.length; k++){
			ans += array1[i][k] * array2[k][j];
		}
		
		return ans;
	}

}


class TempReaderCall{
	
	static ArrayList<String> getStdInReadlines(BufferedReader br, int line) throws IOException {
		ArrayList<String> list = new ArrayList<String>();
		for (int i = 0; i < line; i++)
			list.add(br.readLine());
		return list;
	}
	
	static String getStdInRead(BufferedReader br) throws IOException {
		return (br.readLine());
	}
	
	
	static int[] splitIntArrayFromString(String st) {
		String[] sts = st.split(" ");
		int[] data = new int[sts.length];
		
		for (int i=0;i<sts.length;i++){
			data[i] = Integer.parseInt(sts[i]);
		}
		
		return data;
	}
}