#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, b[N], c[N];
struct Node {
  int to, rev, used;
};
map<int, int> d;
map<int, multiset<int> > G;
vector<int> lst;
void dfs(int u) {
  while (!G[u].empty()) {
    int v = *G[u].begin();
    G[u].erase(G[u].begin());
    G[v].erase(G[v].find(u));
    dfs(v);
  }
  lst.push_back(u);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d", &b[i]);
  for (int i = 1; i < n; i++) scanf("%d", &c[i]);
  for (int i = 1; i < n; i++) {
    if (b[i] > c[i]) {
      puts("-1");
      return 0;
    }
    G[b[i]].insert(c[i]);
    G[c[i]].insert(b[i]);
    d[b[i]]++, d[c[i]]++;
  }
  int cntodd = 0, st = d.begin()->first;
  for (auto it : d) {
    if (it.second & 1) cntodd++, st = it.first;
  }
  if (cntodd != 0 && cntodd != 2) {
    puts("-1");
    return 0;
  }
  dfs(st);
  if ((int)lst.size() != n) {
    puts("-1");
    return 0;
  }
  for (int i = 0; i < n; i++) printf("%d ", lst[i]);
  return 0;
}
