#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
int c;
int n,k;
struct edge
{
	int u,v;
} e[114514];
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++)
	if(c==18)
	{
		printf("1\n");
		return ;
	}
	printf("114514");
}
int main()
{
	int c,t;
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	scanf("%d%d",&c,&t);
	while(t--)
	work();
	return 0;
}
/*

1
5 1 2
1 2

*/
