#include using namespace std; int main() { int n, m; char op; cin >> n >> m >> op; vector a(n), b(m); for (auto &e : b) cin >> e; for (auto &e : a) cin >> e; long long ans[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (op == '+') ans[i][j] = a[i] + b[j]; else ans[i][j] = a[i] * b[i]; } } for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cout << ans[i][j] << (j+1 == m ? '\n' : ' '); } } return 0; }