"use strict" const main = (INPUT) => { const input = INPUT.split("\n") const N = input[0].split(' ')[0] const M = input[0].split(' ')[1] input.shift() const b = input[0].split(" ") const op = b.shift() input.shift() for (let i = 0; i < N; i++) { let ans = "" for (let j = 0; j < M; j++) { ans += ` ${eval(`${input[i]}${op}${b[j]}`)}` } console.log(ans.trim()) } } main(require("fs").readFileSync("/dev/stdin", "utf8"))