func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   map<int, int> mpp;   map<int, int> tmp;   multiset<int> adj[200005];   multiset<pair<int, int> > pairs;   int cnt[200005];   int arra[100005];   int arrb[100005];   list<int> ans;   void addpair(int u, int v) {     pairs.insert(make_pair(u, v));     pairs.insert(make_pair(v, u));   }   void removepair(int u, int v) {     pairs.erase(pairs.find(make_pair(u, v)));     pairs.erase(pairs.find(make_pair(v, u)));   }   int ispair(int u, int v) {     if (pairs.find(make_pair(u, v)) == pairs.end()) return 0;     return 1;   }   void bit() {     printf( -1 n );     exit(0);   }   int main() {     clock_t start = clock();     scanf( %d , &n);     for (int i = 0; i < 2 * n; i++) cnt[i] = 0;     for (int i = 0; i < n - 1; i++) {       scanf( %d , arra + i);     }     for (int i = 0; i < n - 1; i++) {       scanf( %d , arrb + i);     }     for (int i = 0; i < n - 1; i++) {       int a = arra[i], b = arrb[i];       int ai = i * 2, bi = i * 2 + 1;       if (a > b) bit();       if (tmp.count(a))         ai = tmp[a];       else {         tmp[a] = ai;         mpp[ai] = a;       }       if (tmp.count(b))         bi = tmp[b];       else {         tmp[b] = bi;         mpp[bi] = b;       }       cnt[ai]++;       cnt[bi]++;       addpair(ai, bi);       adj[ai].insert(bi);       adj[bi].insert(ai);     }     int tek1 = -1;     int tek2 = -1;     for (int i = 0; i < 2 * n; i++) {       if (cnt[i] % 2 == 1) {         if (tek2 != -1)           bit();         else if (tek1 != -1)           tek2 = i;         else           tek1 = i;       }     }     if (tek1 != -1 && tek2 == -1) assert(0);     list<int> ans;     if (tek1 == -1) {       tek1 = 0;     }     stack<int> st;     st.push(tek1);     while (!st.empty()) {       int node = st.top();       if (adj[node].size() == 0) {         ans.push_back(mpp[node]);         st.pop();       } else {         st.push(*adj[node].begin());         adj[*adj[node].begin()].erase(adj[*adj[node].begin()].find(node));         adj[node].erase(adj[node].begin());       }     }     for (int i = 0; i < 2 * n; i++) {       if (adj[i].size() != 0) bit();     }     for (list<int>::iterator it = ans.begin(); it != ans.end(); ++it) {       printf( %d  , *it);     }   }   