#include <bits/stdc++.h>   using namespace std;   template <typename T>   void print(T x) {     cout << x << endl;   }   template <typename T1, typename T2>   void print2(T1 x, T2 y) {     cout << x <<     << y << endl;   }   template <typename T1, typename T2, typename T3>   void print3(T1 x, T2 y, T3 z) {     cout << x <<     << y <<     << z << endl;   }   void chandan1() {     int y = 1;     return;   }   void chandan2() {     for (long long int i = 0; i < 10; i++) {       long long int x = 1;     }     return (chandan1());   }   vector<long long int> path;   void bfs(vector<long long int> adj[], long long int v, long long int source,            long long int destin) {     bool vis[v + 1];     long long int parent[v + 1];     for (long long int i = 0; i < v + 1; i++) {       vis[i] = 0;     }     parent[source] = source;     queue<long long int> q;     q.push(source);     vis[source] = 1;     while (q.empty() == false) {       long long int u = q.front();       q.pop();       for (auto xt : adj[u]) {         if (vis[xt] == 0) {           vis[xt] = 1;           parent[xt] = u;           q.push(xt);         }       }     }     vector<long long int> temp;     while (parent[destin] != destin) {       temp.emplace_back(destin);       destin = parent[destin];     }     reverse(temp.begin(), temp.end());     for (auto xt : temp) path.emplace_back(xt);   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long int t = 1;     chandan2();     while (t--) {       long long int v, e;       cin >> v;       vector<long long int> adj[v + 1];       for (long long int i = 0; i < v - 1; i++) {         long long int a, b;         cin >> a >> b;         adj[a].emplace_back(b);         adj[b].emplace_back(a);       }       vector<long long int> leaves;       leaves.emplace_back(1);       long long int val;       while (cin >> val) {         leaves.emplace_back(val);       }       leaves.emplace_back(1);       path.emplace_back(1);       for (long long int i = 0; i < int(leaves.size()) - 1; i++) {         long long int src = leaves[i];         long long int desti = leaves[i + 1];         bfs(adj, v, src, desti);       }       if (int(path.size()) > (2 * v - 1))         print(-1);       else {         for (auto xt : path) cout << xt <<    ;         cout <<   n ;         ;       }     }     return 0;   }   