const input = require("fs").readFileSync(0,"utf8").toString().split("\n");
[n, m] = input[0].split(' ').map(Number);
let arr = []

for(let i=1; i<=n; i++){
    let a = input[i].split(' ').map(Number);
    let b = input[i+n].split(' ').map(Number);
    arr[i-1]= a.map((v,idx) => v+b[idx]);
}

for(let i=0; i<n; i++){
    console.log(...arr[i]);
}