#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
long long n, m;
int b[maxn], c[maxn];
deque<int> ans1;
map<int, int> q;
map<int, int> pp;
vector<int> ans;
multiset<int, greater<int> > g[maxn];
bool vis[maxn];
int bh[maxn];
int d[maxn];
int tot = 0;
bool flag = 0;
int cnt = 0;
int sum = 0;
map<int, int>::iterator iter;
inline void dfs(int x) {
  if (flag) {
    return;
  }
  int num = bh[x];
  set<int>::iterator iters;
  while (g[x].size()) {
    if (flag) break;
    iters = g[x].begin();
    int to = *iters;
    if (!vis[to]) {
      int go = (num == b[to]) ? c[to] : b[to];
      iter = pp.find(go);
      int number = pp[iter->first];
      vis[to] = 1;
      g[x].erase(iters);
      dfs(number);
    } else
      g[x].erase(iters);
  }
  ans1.push_back(num);
  if (ans1.size() == n - sum) {
    flag = 1;
  }
  return;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d", &b[i]);
  }
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d", &c[i]);
  }
  for (int i = 1; i <= n - 1; i++) {
    if (b[i] > c[i]) {
      puts("-1");
      return 0;
    } else if (b[i] == c[i]) {
      sum++;
      vis[i] = 1;
      iter = q.find(b[i]);
      if (iter != q.end()) {
        iter->second++;
      } else {
        q.insert(make_pair(b[i], 1));
      }
    } else {
      iter = pp.find(b[i]);
      if (iter == pp.end()) {
        pp.insert(make_pair(b[i], tot));
        g[tot].insert(i);
        d[tot]++;
        bh[tot] = b[i];
        tot++;
      } else {
        g[iter->second].insert(i);
        d[iter->second]++;
      }
      iter = pp.find(c[i]);
      if (iter == pp.end()) {
        pp.insert(make_pair(c[i], tot));
        g[tot].insert(i);
        bh[tot] = c[i];
        d[tot]++;
        tot++;
      } else {
        g[iter->second].insert(i);
        d[iter->second]++;
      }
    }
  }
  int num = 0;
  int u = -1;
  for (int i = 0; i < tot; i++) {
    if (d[i] & 1) {
      num++;
      u = i;
    }
  }
  if (num != 0 && num != 2) {
    puts("-1");
    return 0;
  }
  if (num == 0) {
    if (g[0].size() != 0) {
      dfs(0);
    }
  } else {
    dfs(u);
  }
  if (!flag && ans1.size() != 0) {
    puts("-1");
    return 0;
  }
  sum = 0;
  if (ans1.size() != 0) {
    for (int i = 0; i < ans1.size(); i++) {
      ans.push_back(ans1[i]);
      sum++;
      iter = q.find(ans1[i]);
      if (iter != q.end()) {
        for (int j = 0; j < iter->second; j++) {
          ans.push_back(ans1[i]);
          sum++;
        }
        q.erase(iter->first);
      }
    }
  } else {
    iter = q.begin();
    for (int i = 0; i <= iter->second; i++) {
      cout << (iter->first) << " ";
    }
    return 0;
  }
  if (sum == n) {
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i] << " ";
    }
  } else {
    puts("-1");
    return 0;
  }
  return 0;
}
