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