#include using namespace std; using ll = long long; int main() { int n, m; cin >> n >> m; char op; cin >> op; function f = (op == '+' ? [](ll a, ll b){return a + b;} : [](ll a, ll b){return a * b;}); vector b(m), a(n); for(int i = 0; i < m; i++)cin >> b[i]; for(int i = 0; i < n; i++)cin >> a[i]; for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { cout << f(a[i], b[j]) << " "; } cout << endl; } }