func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 1000 * 1000 + 20;   int a[N], x[N], y[N], visited[N], h[N], mark[N], n, t = 0, dady[N];   vector<int> ans, adj[N];   void dfs_mark(int v) {     visited[v] = 1;     for (int i = 0; i < adj[v].size(); i++) {       int u = adj[v][i];       if (visited[u] == 0) {         dfs_mark(u);         mark[v] += mark[u];       }     }   }   void dfs(int v) {     visited[v] = 1;     for (int i = 0; i < adj[v].size(); i++) {       int u = adj[v][i];       if (visited[u] == 0 and mark[u] == 1) {         ans.push_back(u);         dfs(u);       }     }   }   void dfs_child(int v) {     visited[v] = 1;     if (adj[v].size() == 1 and v != 1) {       t++;     }     for (int i = 0; i < adj[v].size(); i++) {       int u = adj[v][i];       if (visited[u] == 0) {         dady[u] = v;         dfs_child(u);       }     }   }   void masir(int v) {     if (v != 1) {       ans.push_back(dady[v]);       masir(dady[v]);     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 1; i++) {       int x, y;       cin >> x >> y;       adj[x].push_back(y);       adj[y].push_back(x);     }     dfs_child(1);     fill(visited, visited + n + 1, 0);     int c, l = 1;     ans.push_back(1);     for (int i = 0; i < t; i++) {       cin >> c;       fill(visited, visited + n + 1, 0);       fill(mark, mark + n + 1, 0);       mark[c] = 1;       dfs_mark(l);       fill(visited, visited + n + 1, 0);       dfs(l);       l = c;     }     masir(c);     if (ans.size() > 2 * n - 1) {       cout << -1;       return 0;     }     for (int i = 0; i < ans.size(); i++) {       cout << ans[i] <<    ;     }   }   