#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<set>
#define REP(i,m) for(int i=0;i<m;++i)
#define REPN(i,m,in) for(int i=in;i<m;++i)
#define ALL(t) (t).begin(),(t).end()
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define dump(x) cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
using namespace std;
static const int INF =500000000;
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
typedef long long int lint;
typedef pair<int,int> pi;
int n,m,q;
vector<pi> g[100005];
pi es[100005];
int enable[100005];
int event[200005];
int ans[100005];
int mark[100005];
void fill(int v){
mark[v]=1;
REP(i,g[v].size()){
int to=g[v][i].fr,id=g[v][i].sc;
if(!mark[to] && enable[id]) fill(to);
}
}
pi range[100005];
int main(){
scanf("%d%d%d",&n,&m,&q);
REP(i,n-1){
int a,b;scanf("%d%d",&a,&b);
--a;--b;
g[a].pb(mp(b,i));
g[b].pb(mp(a,i));
es[i]=mp(a,b);
}
REP(i,m) scanf("%d",&event[i]),--event[i];
if(q==1){//for subtask 1
int root;scanf("%d",&root);--root;
REP(i,m) enable[event[i]]^=1;
fill(root);
for(int i=m-1;i>=0;--i){
int e=event[i];
if(enable[e]==0){
if(mark[es[e].fr]^mark[es[e].sc]){
if(mark[es[e].fr]) swap(es[e].fr,es[e].sc);
fill(es[e].fr);
}
}
enable[e]^=1;
}
int res=0;
REP(i,n) if(mark[i]) ++res;
printf("%d\n",res);
}else{//this is solution for subtask 2
set<int> divs;
REP(i,n) divs.insert(i);
REP(i,n) range[i]=mp(i,i+1);
REP(i,m){
int e=event[i]+1;
set<int>::iterator it=divs.lower_bound(e);
--it;
if(enable[e]==0){
divs.erase(e);
range[*it].sc=range[e].sc;
}else{
divs.insert(e);
range[e]=range[*it];
}
enable[e]^=1;
}
REP(i,n){
set<int>::iterator it=divs.lower_bound(i+1);
--it;
printf("%d\n",range[*it].sc-range[*it].fr);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