#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
const int mod=1e9+7;
int c,T,n,k,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,&k);
		for(int i=1;i<=n;i++){
			int u,v;
			scanf("%d%d",&u,&v);
		}
		for(int i=1;i<=k;i++)
			scanf("%d",&e[i]);
		if(c==18){
			printf("1\n");
			continue;
		}
	}
	return 0;
}
