#include #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair; //N×Mマス計算 int main() { int n,m; cin >> n >> m; char op; cin >> op; vector b(m,0); rep(i,m)cin >> b[i]; vector a(n,0); 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; } } return 0; } /* やっほい!        やほほい!     +    *     ∧∧  . ∧∞∧ * * ヽ(=´ω`)人(´ω`*)ノ  .~( O x.) (   O)~ + 。*   ∪    ∪ */