#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e15;
const long long int MOD = 1e9 + 7;
template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()) {
  return vector2<T>(n0, vector<T>(n1, e));
}
template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()) {
  return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}
void dfs(long long int u, vector<vector<long long int>>& edge,
         vector<long long int>& trail) {
  while (!edge[u].empty()) {
    long long int v = edge[u].back();
    edge[u].pop_back();
    for (long long int i = 0; i < (long long int)edge[v].size(); i++) {
      if (edge[v][i] == u) {
        edge[v].erase(edge[v].begin() + i);
        break;
      }
    }
    dfs(v, edge, trail);
  }
  trail.push_back(u);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  vector<long long int> b(n - 1), c(n - 1);
  for (long long int i = 0; i < (n - 1); ++i) cin >> b[i];
  for (long long int i = 0; i < (n - 1); ++i) cin >> c[i];
  set<long long int> s;
  for (long long int i = 0; i < (n - 1); ++i) {
    if (b[i] > c[i]) {
      cout << -1 << endl;
      return 0;
    }
    s.insert(b[i]);
    s.insert(c[i]);
  }
  long long int m = 0;
  vector<long long int> decode;
  map<long long int, long long int> encode;
  for (auto it = s.begin(); it != s.end(); it++) {
    decode.push_back(*it);
    encode[*it] = m++;
  }
  auto edge = initVec2<long long int>(m, 0);
  for (long long int i = 0; i < (n - 1); ++i) {
    long long int u = encode[b[i]];
    long long int v = encode[c[i]];
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  long long int odd = 0;
  long long int st = -1;
  for (long long int i = 0; i < (m); ++i) {
    if (((long long int)(edge[i]).size()) % 2) {
      odd++;
      st = i;
    }
  }
  if (odd > 2) {
    cout << -1 << endl;
    return 0;
  }
  vector<long long int> ans;
  dfs((st == -1 ? 0 : st), edge, ans);
  if (((long long int)(ans).size()) != n) {
    cout << -1 << endl;
    return 0;
  }
  for (long long int i = 0; i < (((long long int)(ans).size())); ++i) {
    cout << decode[ans[i]] << " ";
  }
  cout << endl;
  return 0;
}
