#include <bits/stdc++.h>
using namespace std;
int n, m, tot;
map<int, int> id;
multiset<int> to[2 * 100000 + 5];
int ans[10 * 100000 + 5], tp, d[2 * 100000 + 5], cnt, p[10 * 100000 + 5];
int b[100000 + 5], c[100000 + 5], val[2 * 100000 + 5];
void dfs(int u) {
  for (auto i = to[u].begin(); i != to[u].end(); i = to[u].begin()) {
    auto v = *i;
    to[u].erase(i), to[v].erase(to[v].lower_bound(u));
    dfs(v);
  }
  ans[++tp] = u;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    scanf("%d", &b[i]);
    if (!id.count(b[i])) id[b[i]] = ++tot, val[tot] = b[i];
  }
  for (int i = 1; i < n; ++i) {
    scanf("%d", &c[i]);
    if (b[i] > c[i]) {
      printf("-1\n");
      return 0;
    }
    if (!id.count(c[i])) id[c[i]] = ++tot, val[tot] = c[i];
    to[id[c[i]]].insert(id[b[i]]), to[id[b[i]]].insert(id[c[i]]);
    d[id[c[i]]]++, d[id[b[i]]]++;
  }
  for (int i = 1; i <= tot; ++i)
    if (d[i] & 1) p[++cnt] = i;
  if (cnt != 0 && cnt != 2)
    printf("-1\n");
  else {
    if (cnt == 0)
      dfs(1);
    else
      dfs(p[1]);
    if (tp != n)
      printf("-1\n");
    else {
      while (tp) printf("%d ", val[ans[tp--]]);
      printf("\n");
    }
  }
  return 0;
}
