#include<bits/stdc++.h>
using namespace std;

const int N=1010;
const int mod=998244353;

string a;
int c,f;
int T,id;
long long int ans;

int main()
{
	freopen("plant.in","r",stdin);
	freopen("plant.out","w",stdout);
	scanf("%d%d",&T,&id);
	while(T--)
		{
			int n,m;
			scanf("%d%d%d%d",&n,&m,&c,&f);
			for(int i=1;i<=n;i++) cin>>a;
			printf("0 0\n");
		}
	return 0;
}