func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 200005;   int n, k, root, col[N], sz[N];   vector<int> g[N], a[N];   int dfs(int v, int pr = -1) {     int mx = col[v];     sz[v] = col[v];     for (auto& to : g[v]) {       if (to == pr) continue;       int root = dfs(to, v);       if (root != -1) return root;       sz[v] += sz[to];       mx = max(mx, sz[to]);     }     mx = max(mx, 2 * k - sz[v]);     if (mx > k) return -1;     return v;   }   void go(int v, int pr = -1) {     priority_queue<pair<int, int>> q;     if (col[v]) {       a[v].push_back(v);       q.push({1, v});     }     for (auto& to : g[v]) {       if (to == pr) continue;       go(to, v);       if (pr != -1) {         if (a[v].size() < a[to].size()) {           a[v].swap(a[to]);         }         a[v].insert(a[v].end(), a[to].begin(), a[to].end());         a[to].clear();       } else {         if (!a[to].empty()) {           q.push({(int)a[to].size(), to});         }       }     }     if (pr == -1) {       while (!q.empty()) {         auto x = q.top();         q.pop();         auto y = q.top();         q.pop();         cout << a[x.second].back() + 1 <<     << a[y.second].back() + 1 <<                  << root + 1 <<   n ;         --x.first;         --y.first;         a[x.second].pop_back();         a[y.second].pop_back();         if (x.first > 0) q.push(x);         if (y.first > 0) q.push(y);       }     }   }   int main() {     ios::sync_with_stdio(false);     cin >> n >> k;     for (int(i) = 0; (i) < (n - 1); ++(i)) {       int x, y;       cin >> x >> y;       --x;       --y;       g[x].push_back(y);       g[y].push_back(x);     }     for (int(i) = 0; (i) < (2 * k); ++(i)) {       int x;       cin >> x;       --x;       col[x] = 1;     }     root = dfs(0);     cout << 1 <<   n  << root + 1 <<   n ;     go(root);     return 0;   }   