#include using namespace std; int main() { int N, M; cin >> N >> M; char op; cin >> op; vector A(N), B(M); for (int j = 0; j < M; ++j) cin >> B[j]; for (int i = 0; i < N; ++i) cin >> A[i]; for (int i = 0; i < N; ++i) { for (int j = 0; j < M; ++j) { if (op == '+') cout << A[i] + B[j]; else cout << A[i] * B[j]; if (j == M - 1) cout << endl; else cout << ' '; } } }