#include<bits/stdc++.h>
using namespace std;
int c,T,n,k,ans;
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,u,v;i<n;i++) scanf("%d%d",&u,&v); 
		for(int i=1,q;i<=k;i++) scanf("%d",&q);
		printf("1\n");
	}
}
