#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
multiset<pair<int, int> > S;
pair<int, int> Edge[200005];
int rev[200005];
int deg[200005];
vector<int> odd;
stack<int> St;
stack<int> Git;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int num = 1;
  for (int i = 1; i < n; i++) {
    int a;
    cin >> a;
    if (M[a] == 0) M[a] = num, rev[num] = a, num++;
    Edge[i].first = M[a];
    deg[M[a]]++;
  }
  for (int i = 1; i < n; i++) {
    int a;
    cin >> a;
    if (M[a] == 0) M[a] = num, rev[num] = a, num++;
    Edge[i].second = M[a];
    deg[M[a]]++;
    if (rev[Edge[i].first] > rev[Edge[i].second]) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 1; i < num; i++) {
    if (deg[i] % 2 == 1) odd.push_back(i);
  }
  if (odd.size() == 0) {
    S.insert(make_pair(1, 0)), S.insert(make_pair(1, 0));
    S.insert(make_pair(0, 1)), S.insert(make_pair(0, 1));
    deg[0] += 2, deg[1] += 2;
  } else if (odd.size() == 2) {
    S.insert(make_pair(0, odd[0])), S.insert(make_pair(odd[0], 0));
    S.insert(make_pair(0, odd[1])), S.insert(make_pair(odd[1], 0));
    deg[0] += 2, deg[odd[0]]++, deg[odd[1]]++;
  } else {
    cout << -1;
    return 0;
  }
  for (int i = 1; i < n; i++)
    S.insert(Edge[i]), S.insert(make_pair(Edge[i].second, Edge[i].first));
  St.push(0);
  while (!St.empty()) {
    int v = St.top();
    if (deg[v] > 0) {
      auto it = S.lower_bound(make_pair(v, 0));
      pair<int, int> kra = *it;
      St.push(kra.second);
      deg[v]--, deg[kra.second]--;
      S.erase(it);
      S.erase(S.find(make_pair(kra.second, kra.first)));
    } else {
      St.pop();
      Git.push(v);
    }
  }
  for (int i = 0; i < num; i++) {
    if (deg[i] > 0) {
      cout << -1;
      return 0;
    }
  }
  while (!Git.empty()) {
    if (Git.top() != 0) cout << rev[Git.top()] << " ";
    Git.pop();
  }
}
