#include #define rep(i, ss, ee) for (ull i = ss; i < ee; ++i) using namespace std; using ull = unsigned long long; void solve() { ull N, M; string op; cin >> N >> M >> op; vector w(M); vector h(N); rep(i, 0, M) { cin >> w[i]; } rep(i, 0, N) { cin >> h[i]; } rep(i, 0, N) { rep(j, 0, M) { cout << ((j == 0) ? "" : " ") << ((op == "+") ? h[i] + w[j] : h[i] * w[j]); } cout << endl; } } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); getchar(); }