#include using namespace std; using ll = long long; using P = pair; using PL = pair; // Welcome to my source code! int main() { int n, m; char c; cin >> n >> m >> c; ll b[m]; for (int i = 0; i < m; i++) cin >> b[i]; for (int i = 0; i < n; i++) { ll a; cin >> a; for (int j = 0; j < m; j++) { if (j > 0) cout << ' '; if (c == '+') cout << b[j] + a; else cout << b[j] * a; } cout << endl; } }