#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 222;
map<int, multiset<int> > G;
inline void add(int s, int d) {
  G[s].insert(d);
  swap(s, d);
  G[s].insert(d);
}
int a[maxn];
int b[maxn];
vector<int> ans;
void dfs(int s) {
  while (!G[s].empty()) {
    int d = (*G[s].begin());
    G[s].erase(G[s].find(d));
    G[d].erase(G[d].find(s));
    dfs(d);
  }
  ans.push_back(s);
}
map<int, int> cnt;
set<int> ji;
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i < n; i++) {
    scanf("%d", &b[i]);
    if (b[i] < a[i]) {
      puts("-1");
      return;
    }
    add(a[i], b[i]);
    cnt[a[i]]++;
    if (cnt[a[i]] % 2 == 1)
      ji.insert(a[i]);
    else
      ji.erase(a[i]);
    cnt[b[i]]++;
    if (cnt[b[i]] % 2 == 1)
      ji.insert(b[i]);
    else
      ji.erase(b[i]);
  }
  if (ji.size() > 2) {
    puts("-1");
    return;
  } else if (ji.size() == 2) {
    dfs(*ji.begin());
  } else {
    dfs(1);
  }
  if (ans.size() != n) {
    puts("-1");
    return;
  }
  for (int a : ans) {
    printf("%d ", a);
  }
  puts("");
}
signed main() { solve(); }
