#include <bits/stdc++.h>
using namespace std;
struct ljb {
  int firstEdge[205000];
  struct edgeNode {
    int x, v, next;
  } edge[405000 * 2];
  int deg[205000], went[405000], m, n, findz, EulerTag;
  ljb() { memset(this, 0, sizeof(*this)); }
  inline void append(int op, int ed, int va) {
    ++m, ++deg[op];
    edge[m].v = va, edge[m].x = ed;
    edge[m].next = firstEdge[op];
    firstEdge[op] = m;
  }
  inline void EulerDfs(const int& now, vector<int>& ans) {
    for (int q = firstEdge[now]; q; q = firstEdge[now]) {
      if (!went[edge[q].v]) {
        went[edge[q].v] = 1;
        ++EulerTag;
        firstEdge[now] = edge[q].next;
        EulerDfs(edge[q].x, ans);
      } else
        firstEdge[now] = edge[q].next;
    }
    ans.push_back(now);
  }
  inline vector<int> EulerCircle() {
    int oddDeg = 0;
    for (int i = 1; i <= n; ++i) {
      if (deg[i] & 1) ++oddDeg;
    }
    EulerTag = 0;
    vector<int> ans;
    if (oddDeg == 2) {
      int f = 0;
      for (int i = 1; i <= n; ++i) {
        if (deg[i] & 1) {
          f = i;
          break;
        }
      }
      EulerDfs(f, ans);
    } else if (!oddDeg) {
      EulerDfs(n, ans);
    }
    if (EulerTag < m / 2) ans.clear();
    return ans;
  }
} graph;
int dt[101000], b[101000], c[101000];
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n - 1; i += 1) {
    cin >> b[i];
  }
  for (int i = 1; i <= n - 1; i += 1) {
    cin >> c[i];
  }
  map<int, int> lsh;
  int l = 0;
  for (int i = 1; i <= n - 1; i += 1) {
    if (b[i] > c[i]) {
      cout << -1 << endl;
      return 0;
    }
    if (lsh.find(b[i]) == lsh.end()) {
      lsh[b[i]] = ++l;
      dt[l] = b[i];
    }
    if (lsh.find(c[i]) == lsh.end()) {
      lsh[c[i]] = ++l;
      dt[l] = c[i];
    }
    graph.append(lsh[b[i]], lsh[c[i]], i);
    graph.append(lsh[c[i]], lsh[b[i]], i);
  }
  graph.n = l;
  vector<int> ans = graph.EulerCircle();
  if (ans.size()) {
    for (auto& k : ans) {
      cout << dt[k] << ' ';
    }
    cout << endl;
  } else
    cout << -1 << endl;
  return 0;
}
