import java.io.*;
import java.util.*;
public class Main {
public static void main
(String[] args
) { Scanner in
= new Scanner
(System.
in);
int n = in.nextInt();
int [][] x = new int [n][n];
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
x[i][j] = in.nextInt();
int r = in.nextInt();
int c = in.nextInt();
for (int i = 0; i < r; i++) {
for (int j = 0; j < c; j++)
out.print(x[i][j] + " ");
out.print("\n");
}
out.flush();
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIE1haW4gewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewoJCVNjYW5uZXIgaW4gPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCVByaW50V3JpdGVyIG91dCA9IG5ldyBQcmludFdyaXRlcihTeXN0ZW0ub3V0KTsKCQkKCQlpbnQgbiA9IGluLm5leHRJbnQoKTsKCQlpbnQgW11bXSB4ID0gbmV3IGludCBbbl1bbl07CgkJZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspCgkJCWZvciAoaW50IGogPSAwOyBqIDwgbjsgaisrKQoJCQkJeFtpXVtqXSA9IGluLm5leHRJbnQoKTsKCQlpbnQgciA9IGluLm5leHRJbnQoKTsKCQlpbnQgYyA9IGluLm5leHRJbnQoKTsKCQlmb3IgKGludCBpID0gMDsgaSA8IHI7IGkrKykgewoJCQlmb3IgKGludCBqID0gMDsgaiA8IGM7IGorKykKCQkJCW91dC5wcmludCh4W2ldW2pdICsgIiAiKTsKCQkJb3V0LnByaW50KCJcbiIpOwoJCX0KCQkKCQlvdXQuZmx1c2goKTsKCX0KfQ==