#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e5+10;
const int mo=1e9+7;
int n,k,bu[N],bv[N];
vector<int>a[N];
signed main() {
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	int T,c;
	cin>>T>>c;
	while(T--) {
		scanf("%lld%lld",&n,&k);
		for(int i=1;i<n;i++) {
			scanf("%lld%lld",&bu[i],&bv[i]);
			a[bu[i]].push_back(i),a[bv[i]].push_back(i);
		}
		if(c==18) {
			printf("1\n");
			continue ;
		}
	}
	return 0;
}

