/*
Task: Problem 7.09
Date: Dec 24, 2020
Author: aLittleLove (Minh Vu)
*/

#include<bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //freopen("input.txt","r",stdin);
    int m, n; cin >> m >> n;
	vector<vector<float> > a(m, vector<float>(n));
	vector<vector<float> > b(m, vector<float>(n));
    for (int i=0; i<m; i++)
        for (int j=0; j<n; j++)
            cin >> a[i][j]; 
    cin >> m >> n;
    for (int i=0; i<m; i++)
        for (int j=0; j<n; j++)
            cin >> b[i][j];
    for (int i=0; i<m; i++)
    {
        for (int j=0; j<n; j++) 
		{
			a[i][j] += b[i][j];
			cout << a[i][j] << " ";
		}
        cout << '\n';
    }
    return 0;
}