#include <cstdio>
using namespace std;
const int N = 1e5+5;
int c, t, n, q;
struct Edge{
	int u, v;
}e[N];
int main(){
	freopen("traverse.in", "r", stdin);
	freopen("traverse.out", "w", stdout);
	scanf("%d%d", &c, &t);
	while(t--){
		scanf("%d%d", &n, &q);
		for(int i=1; i<=n; ++i) scanf("%d%d", &e[i].u, &e[i].v);
		for(int i=1; i<=q; ++i){
			int x; scanf("%d", &x);
		}
		if(c == 18) printf("1\n");
	}
	return 0;
}
