#include using namespace std; int main() { int n, m; cin >> n >> m; char op; cin >> op; int a[n], b[m]; for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { switch (op) { case '+': cout << (a[i] + b[j]) << endl;; break; case '*': cout << (a[i] * b[j]) << endl;; break; } if (j < m - 1) cout << " " << endl; } cout << endl; } return 0; }