#include using namespace std; using namespace chrono; #if __has_include() #include using namespace atcoder; #endif int main() { int64_t n, m; char c; cin >> n >> m >> c; vector bs(m), as(n); for (auto &&b : bs) { cin >> b; } for (auto &&a : as) { cin >> a; } for (int64_t i = 0; i < n; i++) { for (int64_t j = 0; j < m; j++) { if (c == '+') { cout << (as[i] + bs[j]) << ' '; } else if (c == '*') { cout << (as[i] * bs[j]) << ' '; } } cout << endl; } return 0; }