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