#include #define rep(i,n) for(int i=0; i<(n); i++) using namespace std; typedef long long ll; int main(){ ll n,m; cin>>n>>m; string op; cin>>op; vector b(m); rep(i,m) cin>>b[i]; vector a(n); rep(i,n) cin>>a[i]; if(op=="+"){ rep(i,n){ rep(j,m){ cout << a[i]+b[j] << " "; } cout << endl; } } else { rep(i,n){ rep(j,m){ cout << a[i]*b[j] << " "; } cout << endl; } } }