#include #include using namespace std; using namespace atcoder; #define rep(i,n) for(int i=0;i<(int)(n);i++) template inline bool chmax(T&a,T b){if(a inline bool chmin(T&a,T b){if(a>b){a=b;return 1;}return 0;} using ll = long long; int n,m; char op; ll a[110],b[110]; int main () { cin.tie(0); ios::sync_with_stdio(false); cin >> n >> m >> op; rep(i,m) cin >> b[i]; rep(i,m) cin >> a[i]; rep(i,n)rep(j,m) cout << (op=='+' ? a[i]+b[j] : a[i]*b[j]) << (j==m-1 ? '\n' : ' '); }