#include <iostream>
using namespace std;
#define N 100
int main() {
int n, r, c;
cin >> n;
int arr[N][N];
for (int i = 0; i < n; i++) {
for (int j = 0 ; j < n; j++)
cin >> arr[i][j];
}
cin >> r >> c;
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++) {
cout << arr[i][j] << " ";
} cout << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBOIDEwMAoKaW50IG1haW4oKSB7CglpbnQgbiwgciwgYzsKCWNpbiA+PiBuOwoJaW50IGFycltOXVtOXTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CgkJZm9yIChpbnQgaiA9IDAgOyBqIDwgbjsgaisrKSAKCQkJY2luID4+IGFycltpXVtqXTsKCX0KCWNpbiA+PiByID4+IGM7Cglmb3IgKGludCBpID0gMDsgaSA8IHI7IGkrKykgewoJCWZvciAoaW50IGogPSAwOyBqIDwgYzsgaisrKSB7CgkJCWNvdXQgPDwgYXJyW2ldW2pdIDw8ICIgIjsKCQl9IGNvdXQgPDwgZW5kbDsKCX0KCXJldHVybiAwOyAKfQ==