#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
const ll maxn= 1e5+100;
//const ll mod= 1e9+7 ;
const ll base=(maxn-30)*2;
/// con 3 ngay
vector<ll> adj[maxn];

vector<ll> gr[maxn][20];
ll anc[maxn][20];
vector<ll> gr1[maxn];
ll cnt[maxn];
ll dep[maxn];
vector<ll> mrg(vector<ll> nw1,vector<ll> nw2)
{
    ll id1=0;
    ll id2=0;
    vector<ll> ans;
    ll pre=-1e15;
    while (1)
    {
        while (id1<nw1.size()&&nw1[id1]<=pre) id1++;
        while (id2<nw2.size()&&nw2[id2]<=pre) id2++;

        if (id1<nw1.size()&&id2<nw2.size()&&ans.size()<base)
        {

            if (nw1[id1]<nw2[id2])
            {
                ans.pb(nw1[id1]);
                pre=ans.back();
                id1++;
            }
            else
            {
                ans.pb(nw2[id2]);
                pre=ans.back();
                id2++;
            }
        }
        else
        {
            break;
        }
    }
    while (1)
    {
        while (id1<nw1.size()&&nw1[id1]<=pre) id1++;
        if (ans.size()<base&&id1<nw1.size())
        {

            ans.pb(nw1[id1]);
            pre=ans.back();
            id1++;
        }
        else
        {
            break;
        }
    }
    while (1)
    {
        while (id2<nw2.size()&&nw2[id2]<=pre) id2++;
        if (ans.size()<base&&id2<nw2.size())
        {

            ans.pb(nw2[id2]);
            pre=ans.back();
            id2++;
        }
        else
        {
            break;
        }
    }
    return ans;
}
void dfs(ll u,ll par)
{
    anc[u][0]=par;
    gr[u][0].clear();
    gr[u][0]=mrg(gr1[par],gr[u][0]);
    for (int i=1; i<=18; i++)
    {

        gr[u][i]=mrg(gr[u][i-1],gr[anc[u][i-1]][i-1]);
        anc[u][i]=anc[anc[u][i-1]][i-1];
        /*if (u==5)
        {
            cout <<gr[u][i].size()<<endl;
        }*/
    }

    cnt[u]+=(int)(gr1[u].size());
    for (auto to:adj[u])
    {
        if (to==par)
            continue;
        cnt[to]=cnt[u];
        dep[to]=dep[u]+1;
        dfs(to,u);

    }
}
ll lca(ll x,ll y)
{
    if (dep[x]<dep[y])
        swap(x,y);
    ll kc= dep[x]-dep[y];
    for (int i=18; i>=0; i--)
    {
        if (kc&(1ll<<i))
        {
            x=anc[x][i];
        }
    }
    if (x==y)
        return x;
    for (int i=18; i>=0; i--)
    {
        if (anc[x][i]!=anc[y][i])
        {
            x=anc[x][i];
            y=anc[y][i];
        }

    }
    return anc[x][0];

}
ll top_e(ll l,ll y)
{
    ll p=dep[y]-dep[l]-1;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("test.txt","r", stdin);

    if (fopen("atlarge.in","r"))
    {
        freopen("atlarge.in","r", stdin);
        freopen("atlarge.out", "w",stdout);
    }
    ll n, m, q;
    cin>>n>> m>> q;
    for (int i=1; i<=n-1; i++)
    {
        ll x, y;
        cin>>x>> y;
        adj[x].pb(y);
        adj[y].pb(x);
    }

    for (int i=1; i<=m; i++)
    {
        ll x;
        cin>>x;
        gr1[x].pb(i);
    }
    gr1[0].clear();
    for (int i=1; i<=n; i++)
    {
        sort(gr1[i].begin(),gr1[i].end());
        gr1[i].erase(unique(gr1[i].begin(),gr1[i].end()),gr1[i].end());
        while (gr1[i].size()>base)
        {
            gr1[i].pop_back();
        }
    }

    dfs(1,0);
    while (q--)
    {
        ll x, y, a;
        cin>>x>>y>>a;
        if (dep[x]<dep[y])
            swap(x,y);
        ll l=lca(x,y);
        // cout <<l<<" "<<x<<" "<<y<<endl;
        // cout <<k<<endl;
        if (y==l)
        {
            vector<ll> ans;
            ll kc=dep[x]-dep[l];
            ans=mrg(ans,gr1[x]);
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {
                    ans=mrg(ans,gr[x][i]);
                    // cout <<gr[x][i].size()<<" "<<ans.size()<<endl;
                    x=anc[x][i];
                }
            }
            // cout <<k<<" "<<ans.size()<<endl;
            ll k=min((ll)ans.size(),a);

            cout <<k<<" ";
            for (int i=1; i<=k; i++)
            {
                cout <<ans[i-1]<<" ";
            }
            cout <<endl;
        }
        else
        {
            vector<ll> ans;
            ans.clear();
            ll kc=dep[x]-dep[l];
            ans=mrg(ans,gr1[x]);
            ans=mrg(ans,gr1[y]);
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {
                    //cout <<i<<endl;
                    ans=mrg(ans,gr[x][i]);
                    x=anc[x][i];
                }
            }
            kc=dep[y]-dep[l]-1;
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {

                    ans=mrg(ans,gr[y][i]);
                    y=anc[y][i];
                }
            }
            ll k=min((ll)ans.size(),a);
            cout <<k<<" ";
            for (int i=1; i<=k; i++)
            {
                cout <<ans[i-1]<<" ";
            }
            cout <<endl;

        }

    }

}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
const ll maxn= 1e5+100;
//const ll mod= 1e9+7 ;
const ll base=(maxn-30)*2;
/// con 3 ngay
vector<ll> adj[maxn];

vector<ll> gr[maxn][20];
ll anc[maxn][20];
vector<ll> gr1[maxn];
ll cnt[maxn];
ll dep[maxn];
vector<ll> mrg(vector<ll> nw1,vector<ll> nw2)
{
    ll id1=0;
    ll id2=0;
    vector<ll> ans;
    while (id1<nw1.size()&&id2<nw2.size()&&ans.size()<10)
    {
        if (nw1[id1]<nw2[id2])
        {
            ans.pb(nw1[id1]);
            id1++;
        }
        else
        {
            ans.pb(nw2[id2]);
            id2++;
        }
    }
    while (ans.size()<10&&id1<nw1.size())
    {
        ans.pb(nw1[id1]);
        id1++;
    }
    while (ans.size()<10&&id2<nw2.size())
    {
        ans.pb(nw2[id2]);
        id2++;
    }
    return ans;
}
void dfs(ll u,ll par)
{
    anc[u][0]=par;
    gr[u][0].clear();
    gr[u][0]=mrg(gr1[par],gr[u][0]);
    for (int i=1; i<=18; i++)
    {

        gr[u][i]=mrg(gr[u][i-1],gr[anc[u][i-1]][i-1]);
        anc[u][i]=anc[anc[u][i-1]][i-1];
        /*if (u==5)
        {
            cout <<gr[u][i].size()<<endl;
        }*/
    }

    cnt[u]+=(int)(gr1[u].size());
    for (auto to:adj[u])
    {
        if (to==par)
            continue;
        cnt[to]=cnt[u];
        dep[to]=dep[u]+1;
        dfs(to,u);

    }
}
ll lca(ll x,ll y)
{
    if (dep[x]<dep[y])
        swap(x,y);
    ll kc= dep[x]-dep[y];
    for (int i=18; i>=0; i--)
    {
        if (kc&(1ll<<i))
        {
            x=anc[x][i];
        }
    }
    if (x==y)
        return x;
    for (int i=18; i>=0; i--)
    {
        if (anc[x][i]!=anc[y][i])
        {
            x=anc[x][i];
            y=anc[y][i];
        }

    }
    return anc[x][0];

}
ll top_e(ll l,ll y)
{
    ll p=dep[y]-dep[l]-1;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("test.txt","r", stdin);

    if (fopen("atlarge.in","r"))
    {
        freopen("atlarge.in","r", stdin);
        freopen("atlarge.out", "w",stdout);
    }
    ll n, m, q;
    cin>>n>> m>> q;
    for (int i=1; i<=n-1; i++)
    {
        ll x, y;
        cin>>x>> y;
        adj[x].pb(y);
        adj[y].pb(x);
    }

    for (int i=1; i<=m; i++)
    {
        ll x;
        cin>>x;
        gr1[x].pb(i);
    }
    gr1[0].clear();
    for (int i=1; i<=n; i++)
    {
        sort(gr1[i].begin(),gr1[i].end());

    }
    dfs(1,0);
    while (q--)
    {
        ll x, y, a;
        cin>>x>>y>>a;
        if (dep[x]<dep[y])
            swap(x,y);
        ll l=lca(x,y);
        ll p=cnt[x]+cnt[y]-2*cnt[l]+gr1[l].size();
        ll k= min(p,a);
        // cout <<l<<" "<<x<<" "<<y<<endl;
        // cout <<k<<endl;
        if (y==l)
        {
            vector<ll> ans;
            ll kc=dep[x]-dep[l];
             ans=mrg(ans,gr1[x]);
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {
                    ans=mrg(ans,gr[x][i]);
                    // cout <<gr[x][i].size()<<" "<<ans.size()<<endl;
                    x=anc[x][i];
                }
            }
            // cout <<k<<" "<<ans.size()<<endl;

            cout <<k<<" ";
            for (int i=1; i<=k; i++)
            {
                cout <<ans[i-1]<<" ";
            }
            cout <<endl;
        }
        else
        {
            /*
            5 4 1
            1 3
            1 2
            1 4
            4 5
            2 1 4 3
            2 3 3
            */
            vector<ll> ans;
            ans.clear();
            ll kc=dep[x]-dep[l];
            ans=mrg(ans,gr1[x]);
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {
                    //cout <<i<<endl;
                    ans=mrg(ans,gr[x][i]);
                    x=anc[x][i];
                }
            }
           // cout <<k<<" "<<ans.size()<<endl;
           /*for (auto to:ans)
           {
               cout <<to<<" ";
           }
           cout <<endl; */
            kc=dep[y]-dep[l]-1;
            //cout <<ans.size()<<" "<<
            //cout <<kc;
             for (int i=18;i>=0;i--)
            {
              if (kc&(1ll<<i))
              {

                  ans=mrg(ans,gr[y][i]);
                  y=anc[y][i];
              }
            }
            if (x!=y)
            {
                ans=mrg(ans,gr1[y]);
            }
            cout <<k<<" ";
            for (int i=1; i<=k; i++)
            {
                cout <<ans[i-1]<<" ";
            }
            cout <<endl;

        }

    }

}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
const ll maxn= 1e5+100;
//const ll mod= 1e9+7 ;
const ll base=(maxn-30)*2;
/// con 3 ngay
vector<ll> adj[maxn];

vector<ll> gr[maxn][20];
ll anc[maxn][20];
vector<ll> gr1[maxn];
ll cnt[maxn];
ll dep[maxn];
vector<ll> mrg(vector<ll> nw1,vector<ll> nw2)
{
    ll id1=0;
    ll id2=0;
    vector<ll> ans;
    while (id1<nw1.size()&&id2<nw2.size()&&ans.size()<10)
    {
        if (nw1[id1]<nw2[id2])
        {
            ans.pb(nw1[id1]);
            id1++;
        }
        else
        {
            ans.pb(nw2[id2]);
            id2++;
        }
    }
    while (ans.size()<10&&id1<nw1.size())
    {
        ans.pb(nw1[id1]);
        id1++;
    }
    while (ans.size()<10&&id2<nw2.size())
    {
        ans.pb(nw2[id2]);
        id2++;
    }
    return ans;
}
void dfs(ll u,ll par)
{
    anc[u][0]=par;
    gr[u][0]=mrg(gr1[par],gr1[u]);
    for (int i=1; i<=18; i++)
    {

        gr[u][i]=mrg(gr[u][i-1],gr[anc[u][i-1]][i-1]);
        anc[u][i]=anc[anc[u][i-1]][i-1];
        /*if (u==5)
        {
            cout <<gr[u][i].size()<<endl;
        }*/
    }

    cnt[u]+=(int)(gr1[u].size());
    for (auto to:adj[u])
    {
        if (to==par)
            continue;
        cnt[to]=cnt[u];
        dep[to]=dep[u]+1;
        dfs(to,u);

    }
}
ll lca(ll x,ll y)
{
    if (dep[x]<dep[y])
        swap(x,y);
    ll kc= dep[x]-dep[y];
    for (int i=18; i>=0; i--)
    {
        if (kc&(1ll<<i))
        {
            x=anc[x][i];
        }
    }
    if (x==y)
        return x;
    for (int i=18; i>=0; i--)
    {
        if (anc[x][i]!=anc[y][i])
        {
            x=anc[x][i];
            y=anc[y][i];
        }

    }
    return anc[x][0];

}
ll top_e(ll l,ll y)
{
    ll p=dep[y]-dep[l]-1;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //freopen("test.txt","r", stdin);

    if (fopen("atlarge.in","r"))
    {
        freopen("atlarge.in","r", stdin);
        freopen("atlarge.out", "w",stdout);
    }
    ll n, m, q;
    cin>>n>> m>> q;
    for (int i=1; i<=n-1; i++)
    {
        ll x, y;
        cin>>x>> y;
        adj[x].pb(y);
        adj[y].pb(x);
    }

    for (int i=1; i<=m; i++)
    {
        ll x;
        cin>>x;
        gr1[x].pb(i);
    }
    gr1[0].clear();
    for (int i=1; i<=n; i++)
    {
        sort(gr1[i].begin(),gr1[i].end());

    }
    dfs(1,0);
    while (q--)
    {
        ll x, y, a;
        cin>>x>>y>>a;
        if (dep[x]<dep[y])
            swap(x,y);
        ll l=lca(x,y);
        ll p=cnt[x]+cnt[y]-2*cnt[l]+gr1[l].size();
        ll k= min(p,a);
        // cout <<l<<" "<<x<<" "<<y<<endl;
        // cout <<k<<endl;
        if (y==l)
        {
            vector<ll> ans;
            ll kc=dep[x]-dep[l];
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {
                    ans=mrg(ans,gr[x][i]);
                    // cout <<gr[x][i].size()<<" "<<ans.size()<<endl;
                    x=anc[x][i];
                }
            }
            // cout <<k<<" "<<ans.size()<<endl;
            if (kc==0)
            {
                ans=mrg(ans,gr1[x]);
            }
            cout <<k<<" ";
            for (int i=1; i<=k; i++)
            {
                cout <<ans[i-1]<<" ";
            }
            cout <<endl;
        }
        else
        {
            /*
            5 4 1
            1 3
            1 2
            1 4
            4 5
            2 1 4 3
            2 3 3
            */
            vector<ll> ans;
            ans.clear();
            ll kc=dep[x]-dep[l];
            for (int i=18; i>=0; i--)
            {
                if (kc&(1ll<<i))
                {
                    //cout <<i<<endl;
                    ans=mrg(ans,gr[x][i]);
                    x=anc[x][i];
                }
            }
           // cout <<k<<" "<<ans.size()<<endl;
           /*for (auto to:ans)
           {
               cout <<to<<" ";
           }
           cout <<endl; */
            kc=dep[y]-dep[l]-1;
            //cout <<ans.size()<<" "<<
            //cout <<kc;
             for (int i=18;i>=0;i--)
            {
              if (kc&(1ll<<i))
              {

                  ans=mrg(ans,gr[y][i]);
                  y=anc[y][i];
              }
            }
            if (kc==0)
            {
                ans=mrg(ans,gr1[y]);
            }
            cout <<k<<" ";
            for (int i=1; i<=k; i++)
            {
                cout <<ans[i-1]<<" ";
            }
            cout <<endl;

        }

    }

}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b, int x = 10){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(x);
  while (!a.empty() || !b.empty()){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
    if (c.size() == x){
      break;
    }
  }
  return c;
}
struct segment_tree{
	int N;
	vector<vector<int>> ST;
	segment_tree(){
	}
	segment_tree(vector<vector<int>> &A){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<vector<int>>(N * 2 - 1);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	vector<int> query(int L, int R, int i, int l, int r, int x = 10){
		if (R <= l || r <= L){
			return vector<int>();
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m, x), query(L, R, i * 2 + 2, m, r, x), x);
		}
	}
	vector<int> query(int L, int R, int x = 10){
		return query(L, R, 0, 0, N, x);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree ST;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<vector<int>> &A): p(p){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<vector<int>> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree(tmp);
	}
	vector<int> query(int u, int v, int x){
		int w = LCA.lca(u, v);
		vector<int> ans;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1, x), x);
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1, x), x);
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1, x), ans, x);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1, x), ans, x);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition HLD(p, ch, A);
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u, a);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b, int x = 10){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(x);
  while (!a.empty() || !b.empty()){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
    if (c.size() == x){
      break;
    }
  }
  return c;
}
struct segment_tree{
	int N;
	vector<vector<int>> ST;
	segment_tree(){
	}
	segment_tree(vector<vector<int>> &A){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<vector<int>>(N * 2 - 1);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	vector<int> query(int L, int R, int i, int l, int r, int x = 10){
		if (R <= l || r <= L){
			return vector<int>();
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m, x), query(L, R, i * 2 + 2, m, r, x), x);
		}
	}
	vector<int> query(int L, int R, int x = 10){
		return query(L, R, 0, 0, N, x);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree ST;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<vector<int>> &A): p(p){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<vector<int>> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree(tmp);
	}
	vector<int> query(int u, int v, int x){
		int w = LCA.lca(u, v);
		vector<int> ans;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1, x), x);
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1, x), x);
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1, x), ans, x);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1, x), ans, x);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition HLD(p, ch, A);
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u, a);
    int k = t.size();
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b, int x = 10){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(x);
  while (!a.empty() || !b.empty()){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
    if (c.size() == x){
      break;
    }
  }
  return c;
}
template <typename T>
struct segment_tree{
	int N;
	vector<T> ST;
	function<T(T, T)> f;
	T E;
	segment_tree(){
	}
	segment_tree(vector<T> A, function<T(T, T)> f, T E): f(f), E(E){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<T>(N * 2 - 1, E);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	T operator [](int k){
		return ST[N - 1 + k];
	}
	T query(int L, int R, int i, int l, int r){
		if (R <= l || r <= L){
			return E;
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m), query(L, R, i * 2 + 2, m, r));
		}
	}
	T query(int L, int R){
		return query(L, R, 0, 0, N);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
template <typename T>
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree<T> ST;
	function<T(T, T)> f;
	T E;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<T> &A, function<T(T, T)> f, T E): p(p), f(f), E(E){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<T> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree<T>(tmp, f, E);
	}
	T query(int u, int v, int x){
		int w = LCA.lca(u, v);
		T ans = E;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1), x);
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1), x);
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1), ans, x);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1), ans, x);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition<vector<int>> HLD(p, ch, A, f, vector<int>());
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u, a);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(10);
  while (!a.empty() || !b.empty()){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
    if (c.size() == 10){
      break;
    }
  }
  return c;
}
template <typename T>
struct segment_tree{
	int N;
	vector<T> ST;
	function<T(T, T)> f;
	T E;
	segment_tree(){
	}
	segment_tree(vector<T> A, function<T(T, T)> f, T E): f(f), E(E){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<T>(N * 2 - 1, E);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	T operator [](int k){
		return ST[N - 1 + k];
	}
	T query(int L, int R, int i, int l, int r){
		if (R <= l || r <= L){
			return E;
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m), query(L, R, i * 2 + 2, m, r));
		}
	}
	T query(int L, int R){
		return query(L, R, 0, 0, N);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
template <typename T>
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree<T> ST;
	function<T(T, T)> f;
	T E;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<T> &A, function<T(T, T)> f, T E): p(p), f(f), E(E){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<T> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree<T>(tmp, f, E);
	}
	T query(int u, int v){
		int w = LCA.lca(u, v);
		T ans = E;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1));
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1));
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1), ans);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1), ans);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition<vector<int>> HLD(p, ch, A, f, vector<int>());
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 17;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b, int x = 10){
  if (a.empty()){
    if (b.size() > x){
      b.resize(x);
    }
    return b;
  }
  if (b.empty()){
    if (a.size() > x){
      a.resize(x);
    }
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(x);
  while (a.size() > 1 || b.size() > 1){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.size() == x){
      return c;
    }
  }
  return c;
}
struct segment_tree{
	int N;
	vector<vector<int>> ST;
	segment_tree(){
	}
	segment_tree(vector<vector<int>> &A){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<vector<int>>(N * 2 - 1);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	vector<int> query(int L, int R, int i, int l, int r, int x = 10){
		if (R <= l || r <= L){
			return vector<int>();
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m, x), query(L, R, i * 2 + 2, m, r, x), x);
		}
	}
	vector<int> query(int L, int R, int x = 10){
		return query(L, R, 0, 0, N, x);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> next;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &p, vector<vector<int>> &c){
		int N = p.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : c[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		next = vector<vector<int>>(LOG, vector<int>(N, -1));
		for (int i = 0; i < N; i++){
			next[0][i] = p[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (next[i - 1][j] != -1){
					next[i][j] = next[i - 1][next[i - 1][j]];
				}
			}
		}
	}
	int lca(int v, int w){
		if (d[v] > d[w]){
			swap(v, w);
		}
		int diff = d[w] - d[v];
		for (int i = 0; i < LOG; i++){
			if (diff >> i & 1){
				w = next[i][w];
			}
		}
		if (v == w){
			return v;
		}
		for (int i = LOG - 1; i >= 0; i--){
			if (next[i][v] != next[i][w]){
				v = next[i][v];
				w = next[i][w];
			}
		}
		return next[0][v];
	}
};
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, next;
	int t;
	segment_tree ST;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<vector<int>> &A): p(p){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<vector<int>> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree(tmp);
	}
	vector<int> query(int u, int v, int x){
		int w = LCA.lca(u, v);
		vector<int> ans;
		while (next[u] != next[w]){]
			f2(ans, ST.query(in[next[u]], in[u] + 1, x), x);
			u = p[next[u]];
		}
		f2(ans, ST.query(in[w], in[u] + 1, x), x);
		while (next[v] != next[w]){
			f2(ans, ST.query(in[next[v]], in[v] + 1, x), x);
			v = p[next[v]];
		}
		f2(ans, ST.query(in[w] + 1, in[v] + 1, x), x);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition HLD(p, ch, A);
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u, a);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
vector<int> f(vector<int> a, vector<int> b){
  for (int x : b){
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  while (a.size() > 10){
    a.pop_back();
  }
  return a;
}
template <typename T>
struct segment_tree{
	int N;
	vector<T> ST;
	function<T(T, T)> f;
	T E;
	segment_tree(){
	}
	segment_tree(vector<T> A, function<T(T, T)> f, T E): f(f), E(E){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<T>(N * 2 - 1, E);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	T operator [](int k){
		return ST[N - 1 + k];
	}
	T query(int L, int R, int i, int l, int r){
		if (R <= l || r <= L){
			return E;
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m), query(L, R, i * 2 + 2, m, r));
		}
	}
	T query(int L, int R){
		return query(L, R, 0, 0, N);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
template <typename T>
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree<T> ST;
	function<T(T, T)> f;
	T E;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<T> &A, function<T(T, T)> f, T E): p(p), f(f), E(E){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<T> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree<T>(tmp, f, E);
	}
	T query(int u, int v){
		int w = LCA.lca(u, v);
		T tmp1 = E;
		while (next[u] != next[w]){
			tmp1 = f(tmp1, ST.query(in[next[u]], in[u] + 1));
			u = p[next[u]];
		}
		tmp1 = f(tmp1, ST.query(in[w], in[u] + 1));
		T tmp2 = E;
		while (next[v] != next[w]){
			tmp2 = f(ST.query(in[next[v]], in[v] + 1), tmp2);
			v = p[next[v]];
		}
		tmp2 = f(ST.query(in[w] + 1, in[v] + 1), tmp2);
		return f(tmp1, tmp2);
	}
};
int main(){
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition<vector<int>> HLD(p, ch, A, f, vector<int>());
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u);
    while (t.size() > a){
      t.pop_back();
    }
    int k = t.size();
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(10);
  while (!a.empty() || !b.empty()){
    if (a.back() < b.back()){
      c.push_back(a.back());
      a.pop_back();
    } else {
      c.push_back(b.back());
      b.pop_back();
    }
    if (c.size() == 10){
      break;
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
  }
  return c;
}
template <typename T>
struct segment_tree{
	int N;
	vector<T> ST;
	function<T(T, T)> f;
	T E;
	segment_tree(){
	}
	segment_tree(vector<T> A, function<T(T, T)> f, T E): f(f), E(E){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<T>(N * 2 - 1, E);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	T operator [](int k){
		return ST[N - 1 + k];
	}
	T query(int L, int R, int i, int l, int r){
		if (R <= l || r <= L){
			return E;
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m), query(L, R, i * 2 + 2, m, r));
		}
	}
	T query(int L, int R){
		return query(L, R, 0, 0, N);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
template <typename T>
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree<T> ST;
	function<T(T, T)> f;
	T E;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<T> &A, function<T(T, T)> f, T E): p(p), f(f), E(E){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<T> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree<T>(tmp, f, E);
	}
	T query(int u, int v){
		int w = LCA.lca(u, v);
		T ans = E;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1));
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1));
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1), ans);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1), ans);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition<vector<int>> HLD(p, ch, A, f, vector<int>());
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 17;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b, int x = 10){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(x);
  while (a.size() > 1 || b.size() > 1){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      return c;
      break;
    }
    if (c.size() == x){
      return c;
    }
  }
  return c;
}
struct segment_tree{
	int N;
	vector<vector<int>> ST;
	segment_tree(){
	}
	segment_tree(vector<vector<int>> &A){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<vector<int>>(N * 2 - 1);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	vector<int> query(int L, int R, int i, int l, int r, int x = 10){
		if (R <= l || r <= L){
			return vector<int>();
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m, x), query(L, R, i * 2 + 2, m, r, x), x);
		}
	}
	vector<int> query(int L, int R, int x = 10){
		return query(L, R, 0, 0, N, x);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, next;
	int t;
	segment_tree ST;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<vector<int>> &A): p(p){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<vector<int>> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree(tmp);
	}
	vector<int> query(int u, int v, int x){
		int w = LCA.lca(u, v);
		vector<int> ans;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1, x), x);
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1, x), x);
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1, x), ans, x);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1, x), ans, x);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition HLD(p, ch, A);
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u, a);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(10);
  while (!a.empty() || !b.empty()){
    if (a.back() < b.back()){
      c.push_back(a.back());
      a.pop_back();
    } else {
      c.push_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
    if (c.size() == 10){
      break;
    }
  }
  return c;
}
template <typename T>
struct segment_tree{
	int N;
	vector<T> ST;
	function<T(T, T)> f;
	T E;
	segment_tree(){
	}
	segment_tree(vector<T> A, function<T(T, T)> f, T E): f(f), E(E){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<T>(N * 2 - 1, E);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	T operator [](int k){
		return ST[N - 1 + k];
	}
	T query(int L, int R, int i, int l, int r){
		if (R <= l || r <= L){
			return E;
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m), query(L, R, i * 2 + 2, m, r));
		}
	}
	T query(int L, int R){
		return query(L, R, 0, 0, N);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
template <typename T>
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree<T> ST;
	function<T(T, T)> f;
	T E;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<T> &A, function<T(T, T)> f, T E): p(p), f(f), E(E){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<T> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree<T>(tmp, f, E);
	}
	T query(int u, int v){
		int w = LCA.lca(u, v);
		T ans = E;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1));
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1));
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1), ans);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1), ans);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition<vector<int>> HLD(p, ch, A, f, vector<int>());
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
const int INF = 1000000;
vector<int> f(vector<int> a, vector<int> b, int x = 10){
  if (a.empty()){
    return b;
  }
  if (b.empty()){
    return a;
  }
  a.push_back(INF);
  b.push_back(INF);
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(x);
  while (a.size() > 1 || b.size() > 1){
    if (a.back() < b.back()){
      c.emplace_back(a.back());
      a.pop_back();
    } else {
      c.emplace_back(b.back());
      b.pop_back();
    }
    if (c.back() == INF){
      c.pop_back();
      break;
    }
    if (c.size() == x){
      break;
    }
  }
  return c;
}
struct segment_tree{
	int N;
	vector<vector<int>> ST;
	segment_tree(){
	}
	segment_tree(vector<vector<int>> &A){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<vector<int>>(N * 2 - 1);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	vector<int> query(int L, int R, int i, int l, int r, int x = 10){
		if (R <= l || r <= L){
			return vector<int>();
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m, x), query(L, R, i * 2 + 2, m, r, x), x);
		}
	}
	vector<int> query(int L, int R, int x = 10){
		return query(L, R, 0, 0, N, x);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree ST;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<vector<int>> &A): p(p){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<vector<int>> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree(tmp);
	}
	vector<int> query(int u, int v, int x){
		int w = LCA.lca(u, v);
		vector<int> ans;
		while (next[u] != next[w]){
			ans = f(ans, ST.query(in[next[u]], in[u] + 1, x), x);
			u = p[next[u]];
		}
		ans = f(ans, ST.query(in[w], in[u] + 1, x), x);
		while (next[v] != next[w]){
			ans = f(ST.query(in[next[v]], in[v] + 1, x), ans, x);
			v = p[next[v]];
		}
		ans = f(ST.query(in[w] + 1, in[v] + 1, x), ans, x);
		return ans;
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition HLD(p, ch, A);
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u, a);
    int k = min((int) t.size(), a);
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#include <bits/stdc++.h>
using namespace std;
const int LOG = 20;
vector<int> f(vector<int> a, vector<int> b){
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  vector<int> c;
  c.reserve(10);
  while (!a.empty() || !b.empty()){
    if (a.empty()){
      c.push_back(b.back());
      b.pop_back();
    } else if (b.empty()){
      c.push_back(a.back());
      a.pop_back();
    } else if (a.back() < b.back()){
      c.push_back(a.back());
      a.pop_back();
    } else {
      c.push_back(b.back());
      b.pop_back();
    }
    if (c.size() == 10){
      break;
    }
  }
  return c;
}
template <typename T>
struct segment_tree{
	int N;
	vector<T> ST;
	function<T(T, T)> f;
	T E;
	segment_tree(){
	}
	segment_tree(vector<T> A, function<T(T, T)> f, T E): f(f), E(E){
		int n = A.size();
		N = 1;
		while (N < n){
			N *= 2;
		}
		ST = vector<T>(N * 2 - 1, E);
		for (int i = 0; i < n; i++){
			ST[N - 1 + i] = A[i];
		}
		for (int i = N - 2; i >= 0; i--){
			ST[i] = f(ST[i * 2 + 1], ST[i * 2 + 2]);
		}
	}
	T operator [](int k){
		return ST[N - 1 + k];
	}
	T query(int L, int R, int i, int l, int r){
		if (R <= l || r <= L){
			return E;
		} else if (L <= l && r <= R){
			return ST[i];
		} else {
			int m = (l + r) / 2;
			return f(query(L, R, i * 2 + 1, l, m), query(L, R, i * 2 + 2, m, r));
		}
	}
	T query(int L, int R){
		return query(L, R, 0, 0, N);
	}
};
struct lowest_common_ancestor{
	vector<int> d;
	vector<vector<int>> p;
	lowest_common_ancestor(){
	}
	lowest_common_ancestor(vector<int> &P, vector<vector<int>> &C){
		int N = P.size();
		d = vector<int>(N, 0);
		queue<int> Q;
		Q.push(0);
		while (!Q.empty()){
			int v = Q.front();
			Q.pop();
			for (int w : C[v]){
				d[w] = d[v] + 1;
				Q.push(w);
			}
		}
		p = vector<vector<int>>(N, vector<int>(LOG, -1));
		for (int i = 0; i < N; i++){
			p[i][0] = P[i];
		}
		for (int i = 1; i < LOG; i++){
			for (int j = 0; j < N; j++){
				if (p[j][i - 1] != -1){
					p[j][i] = p[p[j][i - 1]][i - 1];
				}
			}
		}
	}
	int lca(int u, int v){
		if (d[u] > d[v]){
			swap(u, v);
		}
		for (int k = 0; k < LOG; k++){
			if ((d[v] - d[u]) >> k & 1){
				v = p[v][k];
			}
		}
		if (u == v){
		    return u;
		}
		for (int k = LOG - 1; k >= 0; k--){
			if (p[u][k] != p[v][k]){
				u = p[u][k];
				v = p[v][k];
			}
		}
		return p[u][0];
	}
};
template <typename T>
struct heavy_light_decomposition{
	lowest_common_ancestor LCA;
	vector<int> p;
	vector<int> sz, in, out, next;
	int t;
	segment_tree<T> ST;
	function<T(T, T)> f;
	T E;
	void dfs1(vector<vector<int>> &c, int v = 0){
		sz[v] = 1;
		for (int &w : c[v]){
			dfs1(c, w);
			sz[v] += sz[w];
			if (sz[w] > sz[c[v][0]]){
				swap(w, c[v][0]);
			}
		}
	}
	void dfs2(vector<vector<int>> &c, int v = 0){
		in[v] = t;
		t++;
		for (int w : c[v]){
			if (w == c[v][0]){
				next[w] = next[v];
			} else {
				next[w] = w;
			}
			dfs2(c, w);
		}
		out[v] = t;
	}
	heavy_light_decomposition(vector<int> &p, vector<vector<int>> &c, vector<T> &A, function<T(T, T)> f, T E): p(p), f(f), E(E){
		LCA = lowest_common_ancestor(p, c);
		int N = p.size();
		in = vector<int>(N, -1);
		out = vector<int>(N, -1);
		sz = vector<int>(N, -1);
		next = vector<int>(N, 0);
		t = 0;
		dfs1(c);
		dfs2(c);
		vector<T> tmp(N);
		for (int i = 0; i < N; i++){
			tmp[in[i]] = A[i];
		}
		ST = segment_tree<T>(tmp, f, E);
	}
	T query(int u, int v){
		int w = LCA.lca(u, v);
		T tmp1 = E;
		while (next[u] != next[w]){
			tmp1 = f(tmp1, ST.query(in[next[u]], in[u] + 1));
			u = p[next[u]];
		}
		tmp1 = f(tmp1, ST.query(in[w], in[u] + 1));
		T tmp2 = E;
		while (next[v] != next[w]){
			tmp2 = f(ST.query(in[next[v]], in[v] + 1), tmp2);
			v = p[next[v]];
		}
		tmp2 = f(ST.query(in[w] + 1, in[v] + 1), tmp2);
		return f(tmp1, tmp2);
	}
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  vector<vector<int>> E(n);
  for (int i = 0; i < n - 1; i++){
    int v, u;
    cin >> v >> u;
    v--;
    u--;
    E[v].push_back(u);
    E[u].push_back(v);
  }
  vector<int> c(m);
  for (int i = 0; i < m; i++){
    cin >> c[i];
    c[i]--;
  }
  vector<int> p(n, -1);
  vector<vector<int>> ch(n);
  queue<int> Q;
  Q.push(0);
  while (!Q.empty()){
    int v = Q.front();
    Q.pop();
    for (int w : E[v]){
      if (w != p[v]){
        p[w] = v;
        ch[v].push_back(w);
        Q.push(w);
      }
    }
  }
  vector<vector<int>> A(n);
  for (int i = 0; i < m; i++){
    A[c[i]].push_back(i + 1);
  }
  for (int i = 0; i < n; i++){
    sort(A[i].begin(), A[i].end());
  }
  heavy_light_decomposition<vector<int>> HLD(p, ch, A, f, vector<int>());
  for (int i = 0; i < q; i++){
    int v, u, a;
    cin >> v >> u >> a;
    v--;
    u--;
    vector<int> t = HLD.query(v, u);
    if (t.size() > a){
      t.resize(a);
    }
    int k = t.size();
    cout << k;
    for (int j = 0; j < k; j++){
      cout << ' ' << t[j];
    }
    cout << "\n";
  }
}


#include <bits/stdc++.h>

using namespace std;
const int N =2e5 +  9 ;
typedef long long  ll ;
#define f first
#define s second
vector < int > adj[N];
int timer;
int in[N] , out[N] , a[N]  , v[N] , vis[N] ;
vector < int > trav;
void dfs(int s , int parent , int par){
   trav.push_back(s);
    v[s] = par;
    in[s] = ++timer ;
    for(int i : adj[s]){
        if(i!=parent)
            dfs(i , s , par ^ 1);
    }
    out[s] = timer;
}
ll pre[N];
int BIT[400010] ;
void upd( int pos , int val )
{
    for ( ; pos < 400010 ; pos += pos & -pos )
        BIT[pos] += val ;
}

int get( int pos )
{
    int sum = 0 ;
    for ( ; pos >= 1 ; pos -= pos & -pos )
        sum += BIT[pos] ;
    return sum ;
}
int main()
{

    int n , m , u , vv , x ,y , z;
    scanf("%d %d" , &n , &m);
    int curr = 1;
    for(int i = 1 ; i<=n ; ++i){
        scanf("%d" , a + i);
    }
    for(int i = 1 ; i <n ; ++i){
        scanf("%d %d" , &u , &vv);
        adj[u].push_back(vv);
        adj[vv].push_back(u);
    }
    dfs(1 , - 1 , 0);
//    for(int i = 0 ; i< n ; ++i){
//        cout << trav[i] << " ";
//    }
//    cout << endl;
//    for(int i = 1 ; i<=n ; ++i){
//        cout << in[i] << " ";
//    }
//    cout << endl;
//    for(int i = 1 ; i<=n ; ++i){
//        cout << out[i] << " ";
//    }
//    cout << endl;
    while ( m-- )
    {
        scanf("%d" , &x);
        if ( x == 2 )
        {
            cin >> y ;
            if ( v[y] & 1 ){
                int ans =  a[y] - get(in[y]) ;
                printf("%d\n" , ans);
            }
            else{
                int ans =  a[y] + get(in[y]) ;
                printf("%d\n" , ans);
            }
        }
        else
        {
            scanf("%d %d" , &y , &z);
            if ( v[y] & 1 )
            {
                upd(in[y],-z) ;
                upd(out[y],z) ;
            }
            else
            {
                upd(in[y],z) ;
                upd(out[y],-z) ;
            }
        }
    }
   //  cout << v[1];
    return 0;
}


    #include<bits/stdc++.h>
    using namespace std;
    typedef long long int ll;
    ll n,m,sz=0;
    vector<ll>v[200005];
    vector< pair<ll,ll> >vnode;
    ll used[200005],pos[200005],from[200005],to[200005],a[200005];
    ll a1[200005],a2[200005],level[200005],level1[200005];
    ll treesum1[2000009],lazysum1[2000009];
    ll treesum2[2000009],lazysum2[2000009];
    ll b[200005],c[200005];
    /*********************************/
    void buildsum1(ll id,ll start,ll end){
    	if(start==end){
    		treesum1[id]=a1[start];
    	}
    	else{
    		ll mid=(start+end)/2;
    		buildsum1(2*id,start,mid);
    		buildsum1(2*id+1,mid+1,end);
    		treesum1[id]=treesum1[2*id]+treesum1[2*id+1];
    	}
    }
    /********************************/
    void updsum1(ll id,ll l,ll r,ll val){
    	if(val){
    	lazysum1[id]+=val;
    	treesum1[id]+=(r-l+1)*val;}
    }
    /*********************************/
    void shiftsum1(ll id,ll l,ll r){
    	ll mid=(l+r)/2;
    	updsum1(2*id,l,mid,lazysum1[id]);
    	updsum1(2*id+1,mid+1,r,lazysum1[id]);
    	lazysum1[id]=0;
    }
    /********************************/
     void updatesum1(ll l,ll r,ll v,ll id,ll start,ll end){
    	if(l>end or r<start)return;
    	if(l<=start&&r>=end){
    		updsum1(id,start,end,v);
    		return ;
    	}
        shiftsum1(id,start,end);
    	ll mid=(start+end)/2;
    	updatesum1(l,r,v,id*2,start,mid);
    	updatesum1(l,r,v,id*2 +1,mid+1,end);
    	treesum1[id]=treesum1[id*2]+treesum1[id*2 +1];
    }
    /*******************************/
    ll querysum1(ll l,ll r,ll id,ll start,ll end){
    	if(l>end or r<start )return 0;
    	if(l<=start&&r>=end)return treesum1[id];
    	shiftsum1(id,start,end);
    	ll mid=(start+end)/2;
    	ll p1=querysum1(l,r,2*id,start,mid);
    	ll p2=querysum1(l,r,2*id+1,mid+1,end);
    	return(p1+p2);
    }
    /****************************************************************************************************/
    void buildsum2(ll id,ll start,ll end){
    	if(start==end){
    		treesum2[id]=a2[start];
    	}
    	else{
    		ll mid=(start+end)/2;
    		buildsum2(2*id,start,mid);
    		buildsum2(2*id+1,mid+1,end);
    		treesum2[id]=treesum2[2*id]+treesum2[2*id+1];
    	}
    }
    /********************************/
    void updsum2(ll id,ll l,ll r,ll val){
    	if(val){
    	lazysum2[id]+=val;
    	treesum2[id]+=(r-l+1)*val;}
    }
    /*********************************/
    void shiftsum2(ll id,ll l,ll r){
    	ll mid=(l+r)/2;
    	updsum2(2*id,l,mid,lazysum2[id]);
    	updsum2(2*id+1,mid+1,r,lazysum2[id]);
    	lazysum2[id]=0;
    }
    /********************************/
     void updatesum2(ll l,ll r,ll v,ll id,ll start,ll end){
    	if(l>end or r<start)return;
    	if(l<=start&&r>=end){
    		updsum2(id,start,end,v);
    		return ;
    	}
        shiftsum2(id,start,end);
    	ll mid=(start+end)/2;
    	updatesum2(l,r,v,id*2,start,mid);
    	updatesum2(l,r,v,id*2 +1,mid+1,end);
    	treesum2[id]=treesum2[id*2]+treesum2[id*2+1];
    }
    /*******************************/
    ll querysum2(ll l,ll r,ll id,ll start,ll end){
    	if(l>end or r<start )return 0;
    	if(l<=start&&r>=end)return treesum2[id];
    	shiftsum2(id,start,end);
    	ll mid=(start+end)/2;
    	ll p1=querysum2(l,r,2*id,start,mid);
    	ll p2=querysum2(l,r,2*id+1,mid+1,end);
    	return(p1+p2);
    }
    /******************************/
    void dfs(int node) {
        used[node]=true;
        pos[node]=++sz;
        from[node]=sz;
        to[node]=sz;
        int i;
        for(i=0;i<(int)(v[node].size());i++) {
            if(!used[v[node][i]]) {
            	level[v[node][i]]=1+level[node];
            	dfs(v[node][i]);to[node]=max(to[node],to[v[node][i]]);
    		}
        }
    }
    /****************************/
    int main(){
    	ios::sync_with_stdio(false);
        cin.tie(NULL);
    	ll i,j,k,nb,x,y,q,op,val;
    	//freopen("a.txt","r",stdin);
    	cin>>n>>q;
    	m=n-1;
    	for(i=1;i<=n;i++)cin>>b[i];
    	while(m--){
    		cin>>x>>y;
    		v[x].push_back(y);
    		v[y].push_back(x);
    	}
    	memset(level,0,sizeof(level));
    	memset(treesum1,0,sizeof(treesum1));
    	memset(treesum2,0,sizeof(treesum2));
    	memset(lazysum1,0,sizeof(lazysum1));
    	memset(lazysum2,0,sizeof(lazysum2));
    	level[1]=1;
    	dfs(1);
    	for(i=1;i<=n;i++)vnode.push_back({pos[i],i});
    	sort(vnode.begin(),vnode.end());
    	for(i=1;i<=n;i++)c[i]=vnode[i-1].second;
    	for(i=1;i<=n;i++){
    		a[i]=b[c[i]];
    	}
    	for(i=1;i<=n;i++)level1[i]=level[c[i]];
    	for(i=1;i<=n;i++){
    		if(level1[i]%2==0){
    			a2[i]=a[i];
    			a1[i]=0;
    		}
    		else{
    			a1[i]=a[i];
    			a2[i]=0;
    	    	}
        	}
        	buildsum1(1,1,n);
        	buildsum2(1,1,n);
    		while(q--){
    		cin>>op;
    		if(op==1){
    			cin>>x>>val;
    			if(level[x]%2==0){
    				updatesum2(from[x],to[x],val,1,1,n);
    				updatesum1(from[x],to[x],-val,1,1,n);
    			}
    			else {
    				updatesum2(from[x],to[x],-val,1,1,n);
    				updatesum1(from[x],to[x],val,1,1,n);
    			}
    		}
    		else if(op==2){
    			cin>>x;
    		    if(level[x]%2==0){
    				 cout<<querysum2(pos[x],pos[x],1,1,n)<<endl;
    			}
    			else{
    				  cout<<querysum1(pos[x],pos[x],1,1,n)<<endl;
    			}
    		}
    	}
    }


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define db double
#define vi vector<ll>
#define vvi vector<vector<int> >
#define vvii vector<vector<pii> >
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl "\n"
#define pii pair<ll,ll>
#define piii pair<ll,pair<ll,ll> >
#define mem(a,b) memset(a , b , sizeof a ) ;
#define pb push_back
#define pf push_front
#define F first
#define S second
#define mp make_pair
#define all(v) v.begin(),v.end()

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

#define deb1(a) cout<<#a<<"=*"<<a<<endl;
#define deb2(a) cout<<#a<<"=@"<<a<<endl;
#define deb3(a) cout<<#a<<"=#"<<a<<endl;
#define deb4(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;
#define deb5(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ll mod=1000000007;
ll vis[212345]={0};
vvi v(212345);
ll d[212345]={0};

ll pow(ll a, ll b, ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}

//extended euclidean algorithm( x is inverse of a wrt b onlt if gcd!=1)
ll gcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1,y1;
	ll d=gcd(b,a%b,x1,y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;

}
ll n;
ll bit[212345];

ll N=200005;
void upd(ll x,ll y,ll val)
{
	for(;x<N;x+=(x&(-x))) bit[x]+=val;
	//deb4(x,y);
	for(;y<N;y+=y&-y) bit[y]-=val;
}

ll query(ll x)
{
	ll s=0;
//	deb2(x);
	for(;x>0;x-=(x&-x)) s+=bit[x];
//	deb2(s);
	return s;
}

vi first(212345,0),endd(212345,0);
ll timer=0;
vi dis;
void dfs(ll k,ll dp)
{
	vis[k]=1;
	d[k]=dp%2;
//	deb1(k);
	dis.pb(k);
	first[k]=++timer;
//	deb4(k,first[k]);
	rep(i,0,v[k].size())
	{
		if(!vis[v[k][i]])
		{
			dfs(v[k][i],dp+1);
		}
	}
	endd[k]=timer;
}

int main()
{
speed
cin>>n;
ll m;
cin>>m;
ll a[n+1];
rep(i,1,n+1)
{
	cin>>a[i];
	//upd(i,a[i]);
}

rep(i,1,n)
{
	ll a,b;
	cin>>a>>b;
	//a--;
	//b--;
	v[a].pb(b);
	v[b].pb(a);
}
dfs(1,1);

rep(i,0,m)
{
	ll z;
	cin>>z;
	if(z==1)
	{
		ll b,c;
		cin>>b>>c;
	//	b--;
		upd(first[b],endd[b]+1,c*(2*d[b]-1));

	}
	else
	{
		ll x;
		cin>>x;
		cout<<query(first[x])*(2*d[x]-1)+a[x]<<endl;
	}

}

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define db double
#define vi vector<ll>
#define vvi vector<vector<int> >
#define vvii vector<vector<pii> >
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl "\n"
#define pii pair<ll,ll>
#define piii pair<ll,pair<ll,ll> >
#define mem(a,b) memset(a , b , sizeof a ) ;
#define pb push_back
#define pf push_front
#define F first
#define S second
#define mp make_pair
#define all(v) v.begin(),v.end()

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

#define deb1(a) cout<<#a<<"=*"<<a<<endl;
#define deb2(a) cout<<#a<<"=@"<<a<<endl;
#define deb3(a) cout<<#a<<"=#"<<a<<endl;
#define deb4(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;
#define deb5(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ll mod=1000000007;
ll vis[212345]={0};
vvi v(212345);
ll d[212345]={0};

ll pow(ll a, ll b, ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}

//extended euclidean algorithm( x is inverse of a wrt b onlt if gcd!=1)
ll gcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1,y1;
	ll d=gcd(b,a%b,x1,y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;

}
ll n;
ll bit[212345];

ll N=200005;
void upd(ll x,ll y,ll val)
{
	for(;x>0;x-=(x&(-x))) bit[x]-=val;
	//deb4(x,y);
	for(;y>0;y-=y&-y) bit[y]+=val;
}

ll query(ll x)
{
	ll s=0;
//	deb2(x);
	for(;x<N;x+=(x&-x)) s+=bit[x];
//	deb2(s);
	return s;
}

vi first(212345,0),endd(212345,0);
ll timer=0;
vi dis;
void dfs(ll k,ll dp)
{
	vis[k]=1;
	d[k]=dp%2;
//	deb1(k);
	dis.pb(k);
	first[k]=++timer;
//	deb4(k,first[k]);
	rep(i,0,v[k].size())
	{
		if(!vis[v[k][i]])
		{
			dfs(v[k][i],dp+1);
		}
	}
	endd[k]=timer;
}

int main()
{
speed
cin>>n;
ll m;
cin>>m;
ll a[n+1];
rep(i,1,n+1)
{
	cin>>a[i];
	//upd(i,a[i]);
}

rep(i,1,n)
{
	ll a,b;
	cin>>a>>b;
	//a--;
	//b--;
	v[a].pb(b);
	v[b].pb(a);
}
dfs(1,1);

rep(i,0,m)
{
	ll z;
	cin>>z;
	if(z==1)
	{
		ll b,c;
		cin>>b>>c;
	//	b--;
		upd(first[b]-1,endd[b],c*(2*d[b]-1));

	}
	else
	{
		ll x;
		cin>>x;
		cout<<query(first[x])*(2*d[x]-1)+a[x]<<endl;
	}

}

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define db double
#define vi vector<ll>
#define vvi vector<vector<int> >
#define vvii vector<vector<pii> >
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl "\n"
#define pii pair<ll,ll>
#define piii pair<ll,pair<ll,ll> >
#define mem(a,b) memset(a , b , sizeof a ) ;
#define pb push_back
#define pf push_front
#define F first
#define S second
#define mp make_pair
#define all(v) v.begin(),v.end()

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

#define deb1(a) cout<<#a<<"=*"<<a<<endl;
#define deb2(a) cout<<#a<<"=@"<<a<<endl;
#define deb3(a) cout<<#a<<"=#"<<a<<endl;
#define deb4(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;
#define deb5(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ll mod=1000000007;
ll vis[212345]={0};
vvi v(212345);
ll d[212345]={0};

ll pow(ll a, ll b, ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}

//extended euclidean algorithm( x is inverse of a wrt b onlt if gcd!=1)
ll gcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1,y1;
	ll d=gcd(b,a%b,x1,y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;

}
ll n;
ll bit[212345];

ll N=200005;
void upd(ll x,ll y,ll val)
{
	for(;x>0;x-=(x&(-x))) bit[x]-=val;
	//deb4(x,y);
	for(;y>0;y-=y&-y) bit[y]+=val;
}

ll query(ll x)
{
	ll s=0;
//	deb2(x);
	for(;x<N;x+=(x&-x)) s+=bit[x];
//	deb2(s);
	return s;
}

vi first(212345,0),end(212345,0);
ll timer=0;
vi dis;
void dfs(ll k,ll dp)
{
	vis[k]=1;
	d[k]=dp%2;
//	deb1(k);
	dis.pb(k);
	first[k]=++timer;
//	deb4(k,first[k]);
	rep(i,0,v[k].size())
	{
		if(!vis[v[k][i]])
		{
			dfs(v[k][i],dp+1);
		}
	}
	end[k]=timer;
}

int main()
{
speed
cin>>n;
ll m;
cin>>m;
ll a[n+1];
rep(i,1,n+1)
{
	cin>>a[i];
	//upd(i,a[i]);
}

rep(i,1,n)
{
	ll a,b;
	cin>>a>>b;
	//a--;
	//b--;
	v[a].pb(b);
	v[b].pb(a);
}
dfs(1,1);

rep(i,0,m)
{
	ll z;
	cin>>z;
	if(z==1)
	{
		ll b,c;
		cin>>b>>c;
	//	b--;
		upd(first[b]-1,end[b],c*(2*d[b]-1));

	}
	else
	{
		ll x;
		cin>>x;
		cout<<query(first[x])*(2*d[x]-1)+a[x]<<endl;
	}

}

}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define si short int
#define speed ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pill pair<ll,ll>
#define f first
#define s second
#define pilc pair<ll,char>
#define all(a) (a).begin(),(a).end()
#define rep(s,e,step) for(int i = (s); i < (e) ; i += step)
#define vrep(s,e,step) for(int j = (s); j < (e) ; j += step)
#define ex exit(0)
#define sz(a) (a).size()

using namespace std;

const ll N = 2e5 + 10;
const ll big = 1e18;
const ll block = 800;
const ll mod = 1e6;

ll n, m;
ll pod[2][N];
ll pos[2][N], num;

ll gl[N];
vector<ll> g[N];

struct seg {
	ll t[4 * N] = {0};
	ll u[4 * N] = {0};
	void push(ll v, ll tl, ll tr) {
		if(tl != tr)
			u[v * 2] += u[v],
			u[v * 2 + 1] += u[v];
		t[v] += (tr - tl + 1) * u[v];
		u[v] = 0;
	}
	void upd(ll l, ll r, ll val, ll v = 1, ll tl = 1, ll tr = n) {
		push(v, tl, tr);
		if(l > tr || tl > r || l > r)
			return;
		if(l <= tl && tr <= r)
			return (void)(u[v] += val, push(v, tl, tr));
		ll m = (tl + tr) / 2;
		upd(l, r, val, v * 2, tl, m);
		upd(l, r, val, v * 2 + 1, m + 1, tr);
		t[v] = t[v * 2] + t[v * 2 + 1];
	}
	ll get(ll pos, ll v = 1, ll l = 1, ll r = n) {
		push(v, l, r);
		if(l == r)
			return t[v];
		ll m = l + r >> 1;
		if(pos <= m)
			return get(pos, v * 2, l, m);
		else
			return get(pos, v * 2 + 1, m + 1, r);
	}
} rt;

void dfs(ll v, ll p) {
	gl[v] = gl[p] + 1;
	for(auto u : g[v]) {
		if(u != p)
			dfs(u, v);
	}
}

void dfs1(ll v, ll p) {
	if(gl[v] % 2)
		pos[1][v] = ++num;
	else
		pos[1][v] = num + 1;
	for(auto u : g[v]) {
		if(u != p)
			dfs1(u, v);
	}
	pod[1][v] = num;
}

void dfs2(ll v, ll p) {
	if(gl[v] % 2 == 0)
		pos[0][v] = ++num;
	else
		pos[0][v] = num + 1;
	for(auto u : g[v]) {
		if(u != p)
			dfs2(u, v);
	}
	pod[0][v] = num;
}

int main() {
    speed;
	cin >> n >> m;
	ll a[n + 1];
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	for(int i = 1; i < n; i++) {
		ll y, x;
		cin >> x >> y;
		g[x].pb(y), g[y].pb(x);
	}
	dfs(1, 0);
	dfs1(1, 0);
	dfs2(1, 0);
	while(m--) {
		ll t, ps, val;
		cin >> t >> ps;
		if(t - 1)
			cout << rt.get(pos[gl[ps] % 2][ps]) + a[ps] << '\n';
		else {
			cin >> val;
			rt.upd(pos[(gl[ps] % 2) ^ 1][ps], pod[(gl[ps] % 2) ^ 1][ps], -val);
			rt.upd(pos[(gl[ps] % 2)][ps], pod[(gl[ps] % 2)][ps], val);
		}
	}
}

/*
*/


#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  f              first
#define  s              second
#define  endl           "\n"
#define  pb             push_back
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" "<<endl;
#define  deb1(a)        cout<<a<<" "<<endl;
#define  deb2(a,b)      cout<<a<<" "<<b<<" "<<endl;
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<" "<<endl;
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  unordered_map<ll,ll>  um;
typedef  vector<pll>           vpll;

const ll   N     =  1e5+5;
const ll   M     =  1e8;
const ll   mod   =  1e9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;

ll test=1, n, q, a[N], tin[N], tout[N], t = 0, ind[N], depth[N];
set <pll> seven, sodd;
vll adj[N], even, odd;

ll tree[N][2] = {};

void update(int idx, int val, int f){
    idx++;
    while(idx <= n+1){
        tree[idx][f] += val;
        idx += idx & (-idx);
    }
}

ll query(int idx, int f){
    idx++;
    ll sum = 0;
    while(idx > 0){
        sum += tree[idx][f];
        idx -= idx & (-idx);
    }
    return sum;
}

void dfs(int x, int p, int d){
    depth[x] = d;
    if(d&1){
        odd.pb(x);
        sodd.insert({t,x});
    }
    else{
        even.pb(x);
        seven.insert({t,x});
    }
    tin[x] = t++;
    for(auto it : adj[x]){
        if(it == p) continue;
        dfs(it,x,d+1);
    }
    tout[x] = t++;
}

void solve(){
    cin>>n>>q;
    for(int i = 1; i <= n; i++) cin>>a[i];
    for(int i = 1; i < n; i++){
        int u,v;
        cin>>u>>v;
        adj[u].pb(v);
    }
    dfs(1,0,0);
    sodd.insert({t,n+1}); ind[n+1] = sodd.size();
    seven.insert({t,n+2}); ind[n+2] = seven.size();
    for(int i = 0; i < odd.size(); i++) ind[odd[i]] = i;
    for(int i = 0; i < even.size(); i++) ind[even[i]] = i;
    for(int i = 1; i <= n; i++){
        if(depth[i]&1){
            update(ind[i],a[i],1);
            update(ind[i]+1,-a[i],1);
        }
        else{
            update(ind[i],a[i],0);
            update(ind[i]+1,-a[i],0);
        }
    }
    while(q--){
        int x,u,v;
        cin>>x;
        if(x == 2){
            cin>>v;
            if(depth[v]&1) deb1(query(ind[v],1))
            else deb1(query(ind[v],0))
        }
        else{
            cin>>v>>u;
            if(depth[v]&1) u = -u;
            pll p = *seven.lower_bound({tin[v],0}), q = *seven.lower_bound({tout[v]+1,0});
            update(ind[p.s],u,0);
            update(ind[q.s],-u,0);
            p = *sodd.lower_bound({tin[v],0}), q = *sodd.lower_bound({tout[v]+1,0});
            update(ind[p.s],-u,1);
            update(ind[q.s],u,1);
        }
    }
}

int main(){
    fastio;
    //cin>>test;
    for(int i = 1; i <= test; i++){
        solve();
    }
    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}


#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  f              first
#define  s              second
#define  endl           "\n"
#define  pb             push_back
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" "<<endl;
#define  deb1(a)        cout<<a<<" "<<endl;
#define  deb2(a,b)      cout<<a<<" "<<b<<" "<<endl;
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<" "<<endl;
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl;

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  unordered_map<ll,ll>  um;
typedef  vector<pll>           vpll;

const ll   N     =  5e5+5;
const ll   M     =  1e8;
const ll   mod   =  1e9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;

ll test=1, n, q, a[N], tin[N], tout[N], t = 0, ind[N], depth[N];
set <pll> seven, sodd;
vll adj[N], even, odd;

ll tree[N][2] = {};

void update(int idx, int val, int f){
    idx++;
    while(idx <= n+1){
        tree[idx][f] += val;
        idx += idx & (-idx);
    }
}

ll query(int idx, int f){
    idx++;
    ll sum = 0;
    while(idx > 0){
        sum += tree[idx][f];
        idx -= idx & (-idx);
    }
    return sum;
}

void dfs(int x, int p, int d){
    depth[x] = d;
    if(d&1){
        odd.pb(x);
        sodd.insert({t,x});
    }
    else{
        even.pb(x);
        seven.insert({t,x});
    }
    tin[x] = t++;
    for(auto it : adj[x]){
        if(it == p) continue;
        dfs(it,x,d+1);
    }
    tout[x] = t++;
}

void solve(){
    cin>>n>>q;
    for(int i = 1; i <= n; i++) cin>>a[i];
    for(int i = 1; i < n; i++){
        int u,v;
        cin>>u>>v;
        adj[u].pb(v);
    }
    dfs(1,0,0);
    sodd.insert({t,n+1}); ind[n+1] = sodd.size();
    seven.insert({t,n+2}); ind[n+2] = seven.size();
    for(int i = 0; i < odd.size(); i++) ind[odd[i]] = i;
    for(int i = 0; i < even.size(); i++) ind[even[i]] = i;
    for(int i = 1; i <= n; i++){
        if(depth[i]&1){
            update(ind[i],a[i],1);
            update(ind[i]+1,-a[i],1);
        }
        else{
            update(ind[i],a[i],0);
            update(ind[i]+1,-a[i],0);
        }
    }
    while(q--){
        int x,u,v;
        cin>>x;
        if(x == 2){
            cin>>v;
            if(depth[v]&1) deb1(query(ind[v],1))
            else deb1(query(ind[v],0))
        }
        else{
            cin>>v>>u;
            if(depth[v]&1) u = -u;
            pll p = *seven.lower_bound({tin[v],0}), q = *seven.lower_bound({tout[v]+1,0});
            update(ind[p.s],u,0);
            update(ind[q.s],-u,0);
            p = *sodd.lower_bound({tin[v],0}), q = *sodd.lower_bound({tout[v]+1,0});
            update(ind[p.s],-u,1);
            update(ind[q.s],u,1);
        }
    }
}

int main(){
    fastio;
    //cin>>test;
    for(int i = 1; i <= test; i++){
        solve();
    }
    #ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}


/*In Case of TLE -> 1.Use Int instead of Long Long
                    2.Use FastIO
                    3.Use "\n" Instead of endl
                    4.Use Vector and Arrays instead of Sets,Maps(if possible)
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> //required
#include <ext/pb_ds/tree_policy.hpp> //required
#define pb push_back
#define pf push_front
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define distinct(x) sort(all(x)); x.resize(unique(all(x))-x.begin());
#define sz(x)  (long long)(x).size()
#define sqr(x) (x)*(x)
#define sof sizeof
#define resz resize
#define ins insert
#define lowerB lower_bound
#define upperB upper_bound
#define mkp make_pair
#define mkt make_tuple
#define act(a,v) (get<(long long)a>(v))
#define mod 1000000007
#define mod1 998244353
#define N 400003  //N idhar hai
#define inf 1e18
#define minf -1e18
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define ms(dp,a) memset(dp,(ll)a,sof(dp))
#define Foreach(i, c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define fr(i,b) for(int (i)=(0);(i) < (b); ++(i))
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define rof(i,a,b) for(int (i)=(a);(i) >= (b); --(i))
#define rep(i, c) for(auto &(i) : (c))
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PRECISION(n) std::cout.unsetf ( std::ios::floatfield );std::cout.precision((ll)n)
#define getsm(v) accumulate(all(v),(ll)0)
#define getmx(v) max_element(all(v))
#define getmn(v) min_element(all(v))
#define wr1(a) cout<<(a)<<endl
#define wr2(a,b) cout<<(a)<<" "<<(b)<<endl
#define wr3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
#define wr4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define ww1(a) cout<<(a)<<"\n"
#define ww2(a,b) cout<<(a)<<" "<<(b)<<"\n"
#define ww3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<"\n"
#define ww4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<"\n"
#define FileIO freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)
#define fill(dp,a,b) for(int i=0;i<a;i++)for(int j=0;j<b;j++)dp[i][j]=-1;
#define PI 3.14159265358979323846264338327950288419716939937510
#define fi first
#define se second
#define here cout<<"RSSB"<<endl
#define showzero cout<<std::showpoint
#define bitcount( x ) __builtin_popcountll( x )
#define ls(i) (1ll<<(i))
using namespace __gnu_pbds; //required
using namespace  std ;
typedef double db;
typedef long long ll ;
typedef vector<int>vi ;
//typedef vector<l>vl ;
typedef vector<ll>vll ;
typedef vector<vector<ll> >vvl ;
typedef pair<int,int> pii ;
typedef pair<ll,ll> pll ;
typedef vector<pll>vpll;
typedef vector<string>vstr;
typedef vector<bool>vbool ;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
void READ(vll &v, ll n){ll a ;for(ll i=0 ; i<n ; i=i+1){cin>>a ;v.pb(a);}}
void PRINT(vll &v , ll a = 0){for(ll i=a ; i<v.size() ; i=i+1){/*v[i] = max((ll)0,v[i]);*/cout<<v[i]<<" " ;}cout<<"\n" ;}
double logy(ll n , ll b){if(b==0){return(-1);}if(n==1){return(0);}return((db)log10(n)/log10(b));}
long long power(long long k , long long n , long long m=mod){long long res = 1;while(n){if(n%2!=0){res = (res*k)%m ;}k = (k*k)%m ;n = n/2 ;}return(res) ;}
double power(double k , long long n ){double res = 1;while(n){if(n%2!=0){res = (res*k) ;}k = (k*k) ;n = n/2 ;}return(res) ;}
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
#define lcm(a,b) ((a/gcd(a,b))*b)
ll n,m,k,h,a1,a2;
db prob;
string str;
bool ok = true;
vvl v;
vll cost,tin,tout,parity,bit(N,0),bit1(N,0);
void add(ll i , ll del)
{
    for( ; i<N ; i+=i&(-i))
    {
        if(ok)
        {
            bit1[i]+=del;
        }
        else
        {
            bit[i]+=del;
        }
    }
}
pll sum(ll i)
{
    ll res = 0;
    ll re = 0;
    for( ; i>0 ; i-=i&(-i))
    {
        res+=bit[i];
        re+=bit1[i];
    }
    return(mkp(res,re));
}
void dfs(ll i , ll par = 1)
{
    tin[i] = h++;
    parity[i] = !parity[par];
    for(auto j : v[i])
    {
        if(j!=par)
        {
            dfs(j,i);
        }
    }
    tout[i] = h++;
}
void solveIt()
{
    ll a,b,c,d,i,j,x,y,z,t;
    ll p,q,r,w;
    string str1,str2;
    char ch;
    cin>>n>>t;
    cost.pb(0);
    READ(cost,n);
    v.resz(n+1);
    tin.resz(n+1);
    tout.resz(n+1);
    parity.resz(n+1);
    h = 1;
    for(i=0 ; i<n-1 ; i++)
    {
        cin>>a>>b;
        v[a].pb(b);
        v[b].pb(a);
    }
    //here;
    parity[1] = 1;
    dfs(1);
    //here;
    //parity[1] becomes zero and then it just assign parity to all nodes as we move along the tree
    while(t--)
    {
        //here;
        cin>>a;
        if(a==1)
        {
            cin>>x>>c;
            ok = parity[x];
            add(tin[x],c);
            add(tout[x]+1,-c);
        }
        else
        {
            cin>>x;
            auto p1 = sum(tin[x]);
            a = p1.fi;
            b = p1.se;
            if(parity[x])
            {
                a = -a;
            }
            else
            {
                b = -b;
            }
            ww1(cost[x]+a+b);
        }
    }
}
int main()
{
    FastIO;
    PRECISION(15);
    //FileIO;
    ll t = 1;
    //cin>>t;
    while(t--)
    {
        solveIt();
    }
    //FOCUS
    //BeABelieverWarrior
    //DO IT UNTIL YOU RUN OUT OF IDEAS ~ YOU KNOW WHO
    //See The Editorial Almost Never ~ YOU KNOW WHO
}


#include <bits/stdc++.h>
using namespace std;
#define ll          long long
#define vl          vector<ll>
#define vi          vector<int>
#define pi          pair<int,int>
#define pl          pair<ll,ll>
#define all(a)      a.begin(),a.end()
#define mem(a,x)    memset(a,x,sizeof(a))
#define pb          push_back
#define mp          make_pair
#define F           first
#define S           second
#define endl 		"\n"
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define fast_io     std::ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define trace(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
template <typename Arg1> void ZZ(const char* name, Arg1&& arg1) {std::cerr << name << " = " << arg1 << endl;}
template <typename Arg1, typename... Args>void ZZ(const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " : " << arg1;
	ZZ(comma, args...);
}
const int maxn = 2e5 + 7;
int n, m;
vi a(maxn), dep(maxn, 0), vis(maxn, 0), beg(maxn, 0), en(maxn, 0);
vi adj[maxn];
int t = 0;
void dfs(int u, int d) {
	if (vis[u])return;
	vis[u]++;
	beg[u] = ++t;
	dep[u] = d;
	// t++;
	for (auto v : adj[u]) {
		dfs(v, d + 1);
	}
	en[u] = t;
}
ll BIT[maxn];
ll query(int x) {
	ll ret = 0;
	while (x > 0) {
		ret += BIT[x];
		x -= (x & -x);
	}
	return ret;
}
void sum(int x, ll val) {
	while (x <= n) {
		BIT[x] += val;
		x += (x & -x);
	}
}
void solve() {
	cin >> n >> m;
	rep(i, 1, n + 1)cin >> a[i];
	rep(i, 0, n - 1) {
		int u, v;
		cin >> u >> v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	dfs(1, 0);
	// rep(i, 1, n + 1) {
	// 	trace(beg[i], en[i], dep[i])
	// }
	rep(i, 0, m) {
		int x;
		cin >> x;
		if (x == 1) {
			int k, val;
			cin >> k >> val;
			sum(beg[k], ((dep[k] & 1) ? -val : val));
			sum(en[k] + 1, ((dep[k] & 1) ? val : -val));
		}
		else {
			int k;
			cin >> k;
			ll val = query(beg[k]);
			if (dep[k] % 2 )val *= -1;
			cout << a[k] + val << endl;
		}
	}
}
int main() {
	fast_io;
	int t = 1;
	// cin>>t;
	while (t--) {
		solve();
	}
	// cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}