#include #define rep(i,n)for(long long i=0;i<(n);i++) using namespace std; typedef long long ll; const int MOD=1e9+7; const int MAX = 510000; const double pi=acos(-1); int main(){ int n,m; char c; cin >> n >> m >> c; vectora(n); vectorb(m); rep(i,m) cin >> b[i]; rep(i,n) cin >> a[i]; if(c=='+'){ rep(i,n){ rep(j,m){ ll ans = a[i]+b[j]; cout << ans<< " "; } cout << endl; } } if(c=='*'){ rep(i,n){ rep(j,m){ ll ans = a[i]*b[j]; cout << ans << " "; } cout << endl; } } return 0; }