#include using namespace std; typedef long long ll; int main() { int n, m; cin >> n >> m; char op; cin >> op; vector col(m), row(n); for (int i = 0; i < m; ++i) cin >> col[i]; for (int i = 0; i < n; ++i) cin >> row[i]; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { long long ans = op == '*'? row[i] * col[j]: row[i] + col[j]; cout << ans; if (j == m - 1)puts(""); else cout << " "; } } return 0; }