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

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	}
}

class Vect {
	List<Vrow> rows = new ArrayList<Vrow>();

	public void addRow(String row) {
		Vrow r = new Vrow(row);
		rows.add(r);
	}

	public void multi(Vect vect1, Vect vect2) {
		for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		}
	}

	private int getRcount() {
		return rows.size();
	}

	private int getCcount() {
		return rows.get(0).getCcount();
	}

	public int getElem(int r, int c) {
		return rows.get(r).get(c);

	}
}

class Vrow {
	List<Integer> elem = new ArrayList<Integer>();

	public Vrow(String row) {
		String[] rows = row.split(" ");
		for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i]));
	}

	public int getCcount() {
		return elem.size();
	}

	public int get(int c) {
		return elem.get(c);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	} main {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	} BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); stdIn new BufferedReader(new InputStreamReader(System.in)) String s; s while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		} (s = stdIn.readLine()) != null (s = stdIn.readLine()) s stdIn.readLine() stdIn.readLine stdIn null {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		} String[] ss = s.split(" "); ss s.split(" ") s.split s " " int vn = Integer.valueOf(ss[0]); vn Integer.valueOf(ss[0]) Integer.valueOf Integer ss[0] ss 0 int vm = Integer.valueOf(ss[1]); vm Integer.valueOf(ss[1]) Integer.valueOf Integer ss[1] ss 1 Vect vect1 = new Vect(); vect1 new Vect() for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine()); int i = 0; int i = 0; i 0 i < vn i vn i++ i++ i vect1.addRow(stdIn.readLine()); vect1.addRow(stdIn.readLine()) vect1.addRow vect1 stdIn.readLine() stdIn.readLine stdIn Vect vect2 = new Vect(); vect2 new Vect() for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine()); int i = 0; int i = 0; i 0 i < vm i vm i++ i++ i vect2.addRow(stdIn.readLine()); vect2.addRow(stdIn.readLine()) vect2.addRow vect2 stdIn.readLine() stdIn.readLine stdIn Vect vect3 = new Vect(); vect3 new Vect() vect3.multi(vect1, vect2) vect3.multi vect3 vect1 vect2 System.exit(0) System.exit System 0 String[] args args class Vect {
	List<Vrow> rows = new ArrayList<Vrow>();

	public void addRow(String row) {
		Vrow r = new Vrow(row);
		rows.add(r);
	}

	public void multi(Vect vect1, Vect vect2) {
		for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		}
	}

	private int getRcount() {
		return rows.size();
	}

	private int getCcount() {
		return rows.get(0).getCcount();
	}

	public int getElem(int r, int c) {
		return rows.get(r).get(c);

	}
} Vect List<Vrow> rows = new ArrayList<Vrow>(); rows new ArrayList<Vrow>() public void addRow(String row) {
		Vrow r = new Vrow(row);
		rows.add(r);
	} addRow {
		Vrow r = new Vrow(row);
		rows.add(r);
	} Vrow r = new Vrow(row); r new Vrow(row) rows.add(r) rows.add rows r String row row public void multi(Vect vect1, Vect vect2) {
		for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		}
	} multi {
		for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		}
	} for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		} int r = 0; int r = 0; r 0 r < vect1.getRcount() r vect1.getRcount() vect1.getRcount vect1 r++ r++ r {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		} {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		} for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			} int c = 0; int c = 0; c 0 c < vect2.getCcount() c vect2.getCcount() vect2.getCcount vect2 c++ c++ c {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			} {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			} int e = 0; e 0 for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c)); int i = 0; int i = 0; i 0 i < vect2.getRcount() i vect2.getRcount() vect2.getRcount vect2 i++ i++ i e += (vect1.getElem(r, i) * vect2.getElem(i, c)); e += (vect1.getElem(r, i) * vect2.getElem(i, c)) e (vect1.getElem(r, i) * vect2.getElem(i, c)) vect1.getElem(r, i) vect1.getElem vect1 r i vect2.getElem(i, c) vect2.getElem vect2 i c if (c > 0)
					System.out.print(" "); c > 0 c 0 System.out.print(" ") System.out.print System.out System System.out " " System.out.print(e) System.out.print System.out System System.out e System.out.println("") System.out.println System.out System System.out "" Vect vect1 vect1 Vect vect2 vect2 private int getRcount() {
		return rows.size();
	} getRcount {
		return rows.size();
	} return rows.size(); rows.size() rows.size rows private int getCcount() {
		return rows.get(0).getCcount();
	} getCcount {
		return rows.get(0).getCcount();
	} return rows.get(0).getCcount(); rows.get(0).getCcount() rows.get(0).getCcount rows.get(0) rows.get rows 0 public int getElem(int r, int c) {
		return rows.get(r).get(c);

	} getElem {
		return rows.get(r).get(c);

	} return rows.get(r).get(c); rows.get(r).get(c) rows.get(r).get rows.get(r) rows.get rows r c int r r int c c class Vrow {
	List<Integer> elem = new ArrayList<Integer>();

	public Vrow(String row) {
		String[] rows = row.split(" ");
		for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i]));
	}

	public int getCcount() {
		return elem.size();
	}

	public int get(int c) {
		return elem.get(c);
	}
} Vrow List<Integer> elem = new ArrayList<Integer>(); elem new ArrayList<Integer>() public Vrow(String row) {
		String[] rows = row.split(" ");
		for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i]));
	} Vrow {
		String[] rows = row.split(" ");
		for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i]));
	} String[] rows = row.split(" "); rows row.split(" ") row.split row " " for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i])); int i = 0; int i = 0; i 0 i < rows.length i rows.length rows rows.length i++ i++ i elem.add(Integer.valueOf(rows[i])); elem.add(Integer.valueOf(rows[i])) elem.add elem Integer.valueOf(rows[i]) Integer.valueOf Integer rows[i] rows i String row row public int getCcount() {
		return elem.size();
	} getCcount {
		return elem.size();
	} return elem.size(); elem.size() elem.size elem public int get(int c) {
		return elem.get(c);
	} get {
		return elem.get(c);
	} return elem.get(c); elem.get(c) elem.get elem c int c c public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	}
}

class Vect {
	List<Vrow> rows = new ArrayList<Vrow>();

	public void addRow(String row) {
		Vrow r = new Vrow(row);
		rows.add(r);
	}

	public void multi(Vect vect1, Vect vect2) {
		for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		}
	}

	private int getRcount() {
		return rows.size();
	}

	private int getCcount() {
		return rows.get(0).getCcount();
	}

	public int getElem(int r, int c) {
		return rows.get(r).get(c);

	}
}

class Vrow {
	List<Integer> elem = new ArrayList<Integer>();

	public Vrow(String row) {
		String[] rows = row.split(" ");
		for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i]));
	}

	public int getCcount() {
		return elem.size();
	}

	public int get(int c) {
		return elem.get(c);
	}
}