#include <cstdio>
#include <algorithm>
#include <queue>
using namespace std;

typedef unsigned long long qword;
typedef unsigned int       dword;
typedef long long          int64;

#define rep(lt, rt, vrb) for (dword vrb = lt; vrb <= rt; vrb++)
#define trv(poitype, begin, end, poi) for (poitype poi = begin; poi != end; poi++)
#define HEAD 1

namespace FastIO {
	template<typename Type>
	inline void read(Type &vrb) {
		static char c = getchar();
		bool neg = false;
		while ('0' > c || c > '9') {
			if (c == '-')
				neg = true;
			c = getchar();
		}
		vrb = 0;
		while ('0' <= c && c <= '9') {
			vrb = (vrb << 3) + (vrb << 1) + (c - '0');
			c = getchar();
		}
		if (neg)
			vrb = -vrb;
	}
	
	template<typename Type>
	inline void read(Type arr[], const dword len) {
		rep(HEAD, len, i)
			read(arr[i]);
	}
	
	inline void read(char *str) {
		static char c = getchar();
		while ('a' > c || c > 'z') 
			c = getchar();
		while ('a' <= c && c <= 'z') {
			*str = c;
			str++;
			c = getchar();
		}
		*str = '\0';
	}
	
	template<typename Type>
	void write(Type vrb, const char end = '\n') {
		if (vrb < 0) {
			putchar('-');
			vrb = -vrb;
		}
		if (vrb > 9)
			write(vrb / 10, '\0');
		putchar((vrb % 10) + '0');
		if (end)
			putchar(end);
	}
	
	template<typename Type>
	void write(Type arr[], const dword len, const char sep = ' ', const char end = '\n') {
		rep(HEAD, len, i)
			write(arr[i], sep);
		if (end)
			putchar(end); 
	}
	
	void write(char *str) {
		while (*str) {
			putchar(*str);
			str++;
		}
	}
	
	void write(const char *str) {
		while (*str) {
			putchar(*str);
			str++;
		}
	}
}


// def mem
const qword INF = 1e9 + 7;
const dword MAXN = 1.5e5;
dword T;
dword n, m, v;
dword c[MAXN];
qword d[MAXN];
qword ans;


int main() {
	freopen("assign.in", "r", stdin);
	freopen("assign.out", "w", stdout);
	using namespace FastIO; 
	read(T);
	while (T--) {
		// in
		read(n), read(m), read(v);
		rep(HEAD, m, i)
			read(c[i]), read(d[i]);
			
		// opt
		
		// out
		write(0);
		
	}
	return 0;
}

