#include <bits/stdc++.h>
using namespace std;
vector<int> seen;
map<int, int> uu;
vector<multiset<int>> g;
int get_num(int x) {
  return (int)(lower_bound(seen.begin(), seen.end(), x) - seen.begin());
}
void add_edge(int a, int b) {
  a = get_num(a);
  b = get_num(b);
  g[a].insert(b);
  g[b].insert(a);
}
vector<int> solve() {
  int s = -1;
  int a = -1;
  int cnt = 0;
  for (int i = 0; i < (int)seen.size(); ++i) {
    if (g[i].size() % 2) {
      ++cnt;
      a = i;
    }
  }
  if (cnt != 0 && cnt != 2) {
    cout << "-1\n";
    exit(0);
  }
  if (a != -1)
    s = a;
  else
    s = 0;
  stack<int> q;
  q.push(s);
  vector<int> eul;
  while (!q.empty()) {
    int u = q.top();
    for (auto v : g[u]) {
      q.push(v);
      g[u].erase(g[u].find(v));
      g[v].erase(g[v].find(u));
      break;
    }
    if (u == q.top()) {
      eul.push_back(u);
      q.pop();
    }
  }
  return eul;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> b(n - 1);
  vector<int> c(n - 1);
  for (auto &t : b) cin >> t;
  for (auto &t : c) cin >> t;
  for (int i = 0; i < n - 1; i++) {
    if (b[i] > c[i]) {
      cout << -1;
      exit(0);
    }
    if (b[i] == c[i]) {
      uu[b[i]]++;
    }
  }
  for (auto t : b) seen.push_back(t);
  for (auto t : c) seen.push_back(t);
  sort(seen.begin(), seen.end());
  seen.resize(unique(seen.begin(), seen.end()) - seen.begin());
  g.resize(seen.size());
  for (int i = 0; i < n - 1; i++) {
    if (b[i] != c[i]) add_edge(b[i], c[i]);
  }
  vector<int> c1 = solve();
  for (auto &t : c1) {
    t = seen[t];
  }
  vector<int> cand;
  for (auto t : c1) {
    cand.push_back(t);
    for (int i = 0; i < uu[t]; i++) {
      cerr << "ADD" << endl;
      cand.push_back(t);
    }
    uu[t] = 0;
  };
  {
    multiset<pair<int, int>> cr;
    for (int i = 0; i < n - 1; i++) {
      cr.insert({min(cand[i], cand[i + 1]), max(cand[i], cand[i + 1])});
    }
    multiset<pair<int, int>> tm;
    for (int i = 0; i < n - 1; i++) {
      tm.insert({b[i], c[i]});
    }
    if (cr != tm) {
      cout << -1;
      exit(0);
    }
  }
  for (auto t : cand) {
    cout << t << ' ';
  }
}
