//输入:
2 3 3 2
1 2 3
4 5 6
//输出:
1 2
3 4
5 6
#include<iostream>
using namespace std;
#include<cstdio>
const int N = 1010;
int a[N];//存储数组元素
int n, m, p, q;
int main()
{
cin >> n >> m >> p >> q;
int idx = 1;//定义存数数组下标
for(int i = 1; i <= n; i ++)
{
for(int j = 1; j <= m; j ++)
{
cin >> a[idx];
idx ++;
}
}
idx = 1;//将idx值恢复到1
for(int i = 1; i <= p; i ++)
{
for(int j = 1; j <= q; j ++)
{
cout << a[idx];
idx ++;
//如果该行已达到要求的列数,就换行
//否则用空格隔开继续循环输出
if(j == q) cout << endl;
else cout << " ";
}
}
return 0;
}