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