#include #include using lint = long long; void solve() { int n, m; std::cin >> n >> m; char c; std::cin >> c; std::vector ys(m); for (auto& y : ys) std::cin >> y; std::vector xs(n); for (auto& x : xs) std::cin >> x; for (auto x : xs) { for (auto y : ys) { std::cout << (c == '+' ? x + y : x * y) << " "; } std::cout << std::endl; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }