#include using namespace std; //#define int long long #define ll long long #define all(v) (v).begin(), (v).end() #define rep(i,n) for(int i=0;i P; typedef vector vl; typedef vector > vvl; typedef vector > > vvvl; ll MOD = 1000000007; const long long L_INF = 1LL << 60; const int INF = 2147483647; // 2^31-1 const double PI = acos(-1); //cout< inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;} template inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;} template void debug(T v){rep(i,v.size()) cout<> n >> m; char c; cin >> c; vector a(n),b(m); rep(i,m) cin >> b[i]; rep(i,n) cin >> a[i]; rep(i,n){ rep(j,m){ if(c == '+'){ if(j!=0) cout << " "; cout << a[i] + b[j]; } else{ if(j!=0) cout << " "; cout << a[i] * b[j]; } } cout << endl; } }