#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
const double PI = acos(-1);
const double eps = (1e-9);
const long long int INF = 2e9;
const int M = (1e9) + 7;
const int N = (2e5) + 3;
vector<int> ar;
vector<multiset<int> > ad(N);
vector<pair<int, int> > edge;
void dfs(int s) {
  while (ad[s].size()) {
    int a = *(ad[s].begin());
    ad[s].erase(ad[s].begin());
    ad[a].erase(ad[a].find(s));
    dfs(a);
  }
  ar.emplace_back(s);
}
int euler_tour(int n, int m) {
  int i, a, b;
  for (i = 0; i < m; ++i) {
    tie(a, b) = edge[i];
    ad[a].insert(b);
    ad[b].insert(a);
  }
  vector<int> odd;
  for (i = 0; i < n; ++i)
    if (ad[i].size() & 1) odd.emplace_back(i);
  if (odd.size() > 2) return 0;
  if (odd.size() == 0) odd.emplace_back(0);
  dfs(odd[0]);
  for (i = 0; i < n; ++i) {
    if (ad[i].size()) return 0;
  }
  return 1;
}
int val[N];
vector<int> compress(vector<int> &temp, int n) {
  vector<pair<int, int> > tp(n);
  int i, j, k;
  for (i = 0; i < n; i++) tp[i].first = temp[i], tp[i].second = i;
  sort(tp.begin(), tp.end());
  vector<int> v(n);
  i = 0, k = 0, j = 0;
  while (i < n) {
    while (j < n && tp[i].first == tp[j].first) v[tp[j].second] = k, j++;
    val[k] = tp[i].first;
    i = j, k++;
  }
  return v;
}
void call() {
  printf("%d\n", -1);
  exit(0);
}
int main() {
  int n, m, i;
  scanf("%d", &n);
  m = n - 1;
  vector<int> v(2 * m);
  for (i = 0; i < m; i++) scanf("%d", &v[i]);
  for (i = m; i < 2 * m; ++i) scanf("%d", &v[i]);
  v = compress(v, 2 * m);
  for (i = 0; i < m; ++i) edge.emplace_back(v[i], v[i + m]);
  for (i = 0; i < m; ++i)
    if (v[i] > v[i + m]) call();
  i = euler_tour(2 * m, m);
  if (!i) call();
  for (i = 0; i < m + 1; ++i) n = ar[i], printf("%d ", val[n]);
}
