func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1100000;   const int M = 21;   vector<int> adj[N];   int par[N][M];   int vis[N];   void dfs(int u, int p) {     par[u][0] = p;     for (int v : adj[u]) {       if (v == p) continue;       dfs(v, u);     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int n, k;     cin >> n >> k;     for (int i = 1; i < n; i++) {       int u, v;       cin >> u >> v;       adj[u].push_back(v);       adj[v].push_back(u);     }     dfs(n, 0);     for (int i = 1; i < M; i++)       for (int j = 1; j <= n; j++) par[j][i] = par[par[j][i - 1]][i - 1];     vis[n] = 1;     int rest = n - k - 1;     for (int i = n - 1; i >= 0; i--) {       if (vis[i]) continue;       int now = i;       int cnt = 0;       for (int j = M - 1; j >= 0; j--) {         int cur = par[now][j];         if (cur == 0 || vis[cur]) continue;         cnt += 1 << j;         now = cur;       }       if (cnt + 1 > rest) continue;       rest -= cnt + 1;       vis[i] = 1;       now = i;       for (int times = 0; times < cnt; times++) {         now = par[now][0];         vis[now] = 1;       }     }     for (int i = 1; i <= n; i++)       if (!vis[i]) cout << i <<    ;     return 0;   }   