#include<bits/stdc++.h>
using namespace std;
const int N=1e6+10,MOD=1e9+7;
#define int long long
int T;
struct node {
	int c,d;
} xz[N];
mt19937_64 rd(time(0));
int x[N];
signed main() {
	freopen("assign.in","r",stdin);
	freopen("assign.out","w",stdout);
	scanf("%lld",&T);
	while(T--) {
		int n,m,v;
		scanf("%lld%lld%lld",&n,&m,&v);
		for(int i=1; i<=m; i++) {
			scanf("%lld%lld",&xz[i].c,&xz[i].d);
		}
		puts("0");
	}
	return 0;
}

