#include int main(){ int n,m; char op; int a[100],b[100]; int table[100][100]; scanf("%d %d\n",&n,&m); scanf("%c",&op); for(int i = 0;i < m;i++){ scanf("%d",&b[i]); //printf("%d ",b[i]); } for(int i = 0;i < n;i++){ scanf("%d",&a[i]); //printf("%d ",a[i]); } if(op == '+'){ for(int i = 0;i < n;i++) for(int j = 0;j < m;j++){ table[i][j] = a[i] + b[j]; //printf("%d + %d = %d\n",a[i],b[j],table[i][j]); } }else if(op == '*'){ for(int i = 0;i < n;i++) for(int j = 0;j < m;j++) table[i][j] = a[i] * b[j]; } for(int i = 0;i < n;i++){ for(int j = 0;j < m;j++){ printf("%d",table[i][j]); if(j == m-1) continue; printf(" "); } printf("\n"); } }