#include #define llint long long using namespace std; llint h, w; char op; llint a[105], b[105]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> h >> w; cin >> op; for(int i = 1; i <= w; i++) cin >> a[i]; for(int i = 1; i <= h; i++) cin >> b[i]; for(int i = 1; i <= h; i++){ for(int j = 1; j <= w; j++){ if(op == '+') cout << a[j]+b[i] << " "; else cout << a[j]*b[i] << " "; } cout << endl; } return 0; }