func_code_string: #include <bits/stdc++.h>   using namespace std;   const long double EPS = 1e-9;   const long double PI = acos(-1.0);   const int MX = 1e5 + 5;   long long mod = 1e9 + 7;   pair<long long, int> tr[5 * MX];   long long lz[5 * MX];   vector<int> ids[MX];   int rnum[MX];   inline void prop(int n, int l, int r) {     if (lz[n]) {       tr[n].first += lz[n];       if (l != r) lz[n << 1] += lz[n], lz[n << 1 | 1] += lz[n];       lz[n] = 0;     }   }   const long long inf = 1e15;   void bld(int n, int l, int r) {     if (l == r) {       if (((int)(ids[l]).size()))         tr[n] = {ids[l].back(), rnum[l]};       else         tr[n] = {inf, 0};       return;     }     int m = (l + r) >> 1;     bld(n << 1, l, m);     bld(n << 1 | 1, m + 1, r);     tr[n] = min(tr[n << 1], tr[n << 1 | 1]);   }   int I, L, R, V;   void del(int n, int l, int r) {     prop(n, l, r);     if (I < l or I > r) return;     if (l == r) {       long long aded = tr[n].first - ids[l].back();       ids[l].pop_back();       if (((int)(ids[l]).size()))         tr[n] = {ids[l].back(), rnum[l]};       else         tr[n] = {inf, rnum[l]};       tr[n].first += aded;       return;     }     int m = (l + r) >> 1;     del(n << 1, l, m);     del(n << 1 | 1, m + 1, r);     tr[n] = min(tr[n << 1], tr[n << 1 | 1]);   }   void upd(int n, int l, int r) {     prop(n, l, r);     if (l > R or r < L) return;     if (l >= L and r <= R) {       lz[n] += V;       prop(n, l, r);       return;     }     int m = (l + r) >> 1;     upd(n << 1, l, m);     upd(n << 1 | 1, m + 1, r);     tr[n] = min(tr[n << 1], tr[n << 1 | 1]);   }   pair<long long, int> qry(int n, int l, int r) {     prop(n, l, r);     if (l > R or r < L) return {inf, 0};     if (l >= L and r <= R) {       return tr[n];     }     int m = (l + r) >> 1;     pair<long long, int> a = qry(n << 1, l, m);     pair<long long, int> b = qry(n << 1 | 1, m + 1, r);     tr[n] = min(tr[n << 1], tr[n << 1 | 1]);     return min(a, b);   }   vector<int> adj[MX];   int par[MX], sz[MX], heavy[MX];   void dfs1(int u, int p) {     par[u] = p;     sz[u] = 1;     for (int v : adj[u]) {       if (v != p) {         dfs1(v, u);         sz[u] += sz[v];         if (sz[v] > sz[heavy[u]]) heavy[u] = v;       }     }   }   int st[MX], chain[MX], num[MX], ed[MX], cl, cn, head[MX];   void dfs(int u) {     st[u] = cl;     chain[u] = cn;     num[u] = cl;     rnum[cl++] = u;     if (heavy[u]) dfs(heavy[u]);     for (int v : adj[u]) {       if (v != par[u] and v != heavy[u]) {         head[++cn] = v;         dfs(v);       }     }     ed[u] = cl - 1;   }   inline int climb(int u, int v, int n) {     pair<long long, int> res = {inf, 0};     while (chain[u] != chain[v]) {       if (chain[v] > chain[u]) swap(u, v);       R = num[u];       L = num[head[chain[u]]];       res = min(res, qry(1, 0, n - 1));       u = par[head[chain[u]]];     }     if (num[v] > num[u]) swap(u, v);     L = num[v], R = num[u];     res = min(res, qry(1, 0, n - 1));     if (res.first >= inf) return 0;     int ret = ids[num[res.second]].back();     I = num[res.second];     del(1, 0, n - 1);     return ret;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, m, q;     cin >> n >> m >> q;     for (int i = 1; i < n; i++) {       int u, v;       cin >> u >> v;       adj[u].push_back(v);       adj[v].push_back(u);     }     dfs1(1, 0);     head[0] = 1;     dfs(1);     for (int i = 1; i <= m; i++) {       int c;       cin >> c;       ids[num[c]].emplace_back(i);     }     for (int i = 0; i < n; i++) reverse((ids[i]).begin(), (ids[i]).end());     bld(1, 0, n - 1);     while (q--) {       int t;       cin >> t;       int u, v, k;       if (t == 1) {         cin >> u >> v >> k;         vector<int> ans;         while (k--) {           int i = climb(u, v, n);           if (i)             ans.push_back(i);           else             break;         }         cout << ((int)(ans).size());         for (int i : ans) cout <<     << i;         cout <<   n ;       } else {         cin >> u >> k;         L = st[u];         R = ed[u];         V = k;         upd(1, 0, n - 1);       }     }     return 0;   }   