#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int N;
pair<int, int> pairs[MAXN + 1];
pair<int, int> adj[MAXN + 1];
int linked;
unordered_map<int, unordered_multiset<int>> locs;
bool member(pair<int, int> &p, int v) { return p.first == v || p.second == v; }
int other(pair<int, int> &p, int v) {
  assert(member(p, v));
  return p.first == v ? p.second : p.first;
}
void removeel(int idx) {
  int a, b;
  tie(a, b) = pairs[idx];
  locs[a].erase(idx);
  locs[b].erase(idx);
}
void link(int from, int to) {
  assert((from == -1 || adj[from].second == -1) &&
         (to == -1 || adj[to].first == -1));
  assert(from == -1 || to == -1 || member(pairs[from], pairs[to].first) ||
         member(pairs[from], pairs[to].second));
  if (from != -1) adj[from].second = to;
  if (to != -1) adj[to].first = from;
  if (from != -1 && to != -1) linked++;
}
int unlink(int node) {
  assert(node >= 0);
  if (adj[node].second == -1) {
    return -1;
  } else {
    linked--;
    int other = adj[node].second;
    adj[node].second = -1;
    adj[other].first = -1;
    return other;
  }
}
[[noreturn]] void impossible() {
  printf("-1\n");
  exit(0);
}
int findpath(int el, int num, int endnum) {
  assert(member(pairs[el], num));
  removeel(el);
  int nxtnum = other(pairs[el], num);
  if (nxtnum == endnum) {
    return el;
  }
  if (locs[nxtnum].empty()) {
    impossible();
  }
  int nxtel = *locs[nxtnum].begin();
  link(el, nxtel);
  return findpath(nxtel, nxtnum, endnum);
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N - 1; ++i) {
    scanf("%d", &pairs[i].first);
    locs[pairs[i].first].insert(i);
  }
  for (int i = 0; i < N - 1; ++i) {
    scanf("%d", &pairs[i].second);
    locs[pairs[i].second].insert(i);
    if (pairs[i].second < pairs[i].first) impossible();
  }
  for (int i = 0; i < N - 1; ++i) {
    adj[i] = {-1, -1};
  }
  int startwith = -1;
  int endwith = -1;
  for (auto &el : locs) {
    if (el.second.size() % 2) {
      if (startwith == -1)
        startwith = el.first;
      else if (endwith == -1)
        endwith = el.first;
      else
        impossible();
    }
  }
  if (startwith != -1) {
    if (endwith == -1) impossible();
  } else {
    assert(endwith == -1);
    startwith = endwith = pairs[0].first;
  }
  int startel = *locs[startwith].begin();
  findpath(startel, startwith, endwith);
  assert(locs[startwith].size() % 2 == 0 && locs[endwith].size() % 2 == 0);
  for (int el = startel, num = startwith; el != -1; el = adj[el].second) {
    num = other(pairs[el], num);
    assert(member(pairs[el], num));
    if (locs[num].empty()) continue;
    int nxt = unlink(el);
    int newnxt = *locs[num].begin();
    int end = findpath(newnxt, num, num);
    link(el, newnxt);
    link(end, nxt);
  }
  while (!locs[startwith].empty()) {
    int el = *locs[startwith].begin();
    findpath(el, startwith, startwith);
    link(el, startel);
    startel = el;
  }
  assert(linked <= N - 2);
  if (linked < N - 2) impossible();
  for (int el = startel, num = startwith;;
       num = other(pairs[el], num), el = adj[el].second) {
    assert(el == -1 || member(pairs[el], num));
    printf("%d ", num);
    if (el == -1) break;
  }
  printf("\n");
}
