import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); //n行 int m = stdIn.nextInt(); //m列 String op = stdIn.next(); int[] b = new int[m]; for(int i = 0; i < m; i++) { b[i] = stdIn.nextInt(); } int[] a = new int[n]; for(int i = 0; i < n; i++) { a[i] = stdIn.nextInt(); } if(op.equals("+")) { for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { System.out.print(a[i]+b[j]+" "); } System.out.println(); } }else { for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { System.out.print(a[i]*b[j]+" "); } System.out.println(); } } } }