#include<bits/stdc++.h>
using namespace std;
int n,k;
int main(){
	freopen("traverse.in","r",stdin);
	freopen("traverse.out","w",stdout);
	scanf("%d%d",&n,&k);
	for(int i=1;i<n;i++){
		int u,v;
		scanf("%d%d",&u,&v);
	}
	for(int i=1;i<=k;i++){
		int g;
		scanf("%d",&g);
		cout<<1<<endl;
	}
	return 0;
}
