#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
int a[N], root, cnta;
int bb[N], cc[N];
multiset<int> G[N << 1];
map<int, int> mp, deg, ls;
vector<int> val;
void dfs(int u) {
  if (!deg[u]) {
    a[++cnta] = u;
    return;
  }
  int v;
  for (auto ite = G[u].begin(); ite != G[u].end(); ite = G[u].begin()) {
    v = *ite;
    G[u].erase(ite);
    G[v].erase(G[v].find(u));
    deg[u]--;
    deg[v]--;
    dfs(v);
  }
  a[++cnta] = u;
}
void addedge(int u, int v) {
  G[u].insert(v);
  ++deg[u];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d", &bb[i]);
    if (mp.count(bb[i])) {
      mp.erase(bb[i]);
    } else {
      mp[bb[i]] = 1;
    }
    val.push_back(bb[i]);
  }
  for (int i = 1; i < n; i++) {
    scanf("%d", &cc[i]);
    if (cc[i] < bb[i]) {
      printf("-1\n");
      return 0;
    }
    if (mp.count(cc[i])) {
      mp.erase(cc[i]);
    } else {
      mp[cc[i]] = 1;
    }
    val.push_back(cc[i]);
  }
  sort(val.begin(), val.end());
  val.resize(unique(val.begin(), val.end()) - val.begin());
  for (int i = 0; i < (int)val.size(); i++) {
    ls[val[i]] = i;
  }
  for (int i = 1; i < n; i++) {
    addedge(ls[bb[i]], ls[cc[i]]);
    addedge(ls[cc[i]], ls[bb[i]]);
  }
  if (!mp.empty()) {
    if (mp.size() > 2) {
      printf("-1\n");
      return 0;
    }
    root = ls[mp.begin()->first];
  } else {
    root = ls[bb[1]];
  }
  dfs(root);
  if (cnta != n) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d%c", val[a[i]], " \n"[i == n]);
  }
  return 0;
}
