import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int raws = sc.nextInt(); int columns = sc.nextInt(); String op = sc.next(); long[] rawNum = new long[raws]; long[] colNum = new long[columns]; for(int i = 0; i < columns; i++) { colNum[i] = sc.nextInt(); } for(int j = 0; j < raws; j++) { rawNum[j] = sc.nextInt(); } for(int k = 0; k < raws; k++) { for(int l = 0; l < columns; l++) { calculate(op, rawNum[k], colNum[l]); System.out.print(" "); } System.out.println(""); } } public static void calculate(String op, long raw, long col) { if(op.equals("*")) { System.out.print(raw * col); } else { System.out.print(raw + col); } } }