#include<bits/stdc++.h>
using namespace std;
int c,T,n,k;
int ed[200005],to[200005],last[200005],head[200005];
struct node{
	int u,v;
}e[200005];
void work(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<n;i++){
		scanf("%d%d",&e[i].u,&e[i].v);
	}
	for(int i=1;i<=k;i++){
		scanf("%d",&ed[i]);
	}
	if(c==18){
		printf("1\n");
		return;
	}
}
int main(){
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	scanf("%d%d",&c,&T);
	while(T--) work();
}
