#include<bits/stdc++.h>
using namespace std;
vector<int> g[100005];
int c,t;
long long n,k,s[100005];
int main(){
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	cin>>c>>t;
	while(t--){
		cin>>n>>k;
		for(int i=1;i<=n-1;i++){
			long long u,v;
			cin>>u>>v;
			g[u].push_back(v);
			g[v].push_back(u);
		}
		for(int i=1;i<=k;i++){
			cin>>s[i];
		}
		cout<<1<<endl;
	}
	return 0;
}
