import java.util.StringTokenizer fun main() { var st = StringTokenizer(readln()) val n = st.nextToken().toInt() val m = st.nextToken().toInt() val arr = Array(n) { IntArray(m) } for (i in 0 until n) { st = StringTokenizer(readln()) for (j in 0 until m) { arr[i][j] = st.nextToken().toInt() } } for (i in 0 until n) { st = StringTokenizer(readln()) for (j in 0 until m) { arr[i][j] += st.nextToken()..