#include <bits/stdc++.h>
using namespace std;
const int nax = 200005;
stack<int> s;
int wsk[nax];
bool Epath(int n, vector<pair<int, int>> (&v)[nax], bool (&odw)[nax],
           vector<int> &ans) {
  int a = -1, b = -1;
  for (int i = 0; n > i; ++i) {
    if ((int)v[i].size() & 1) {
      if (a == -1)
        a = i;
      else if (b == -1)
        b = i;
      else
        return 0;
    }
  }
  if (a != -1) {
    v[a].push_back({b, nax - 1});
    v[b].push_back({a, nax - 1});
  }
  int first = a;
  if (first == -1) first = 0;
  s.push(first);
  while (!s.empty()) {
    int node = s.top();
    int u = -1;
    for (; wsk[node] < (int)v[node].size(); ++wsk[node]) {
      u = v[node][wsk[node]].first;
      int byl = v[node][wsk[node]].second;
      if (!odw[byl]) {
        odw[byl] = 1;
        break;
      }
    }
    if (wsk[node] == (int)v[node].size()) {
      ans.push_back(node);
      s.pop();
    } else {
      s.push(u);
    }
  }
  if (a != -1) {
    vector<int> nowe;
    for (int i = 0; (int)ans.size() > i; ++i) {
      int c = ans[i];
      int d = ans[i + 1];
      if ((a == c && b == d) || (a == d && c == b)) {
        for (int j = i + 1; (int)ans.size() > j; ++j) nowe.push_back(ans[j]);
        for (int j = 1; i >= j; ++j) nowe.push_back(ans[j]);
        break;
      }
    }
    ans = nowe;
  }
  return 1;
}
int n;
int b[nax], c[nax];
map<int, int> mapa, odp;
vector<int> val;
bool odw[nax];
vector<pair<int, int>> v[nax];
vector<int> ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; n - 1 >= i; ++i) cin >> b[i], val.push_back(b[i]);
  for (int i = 1; n - 1 >= i; ++i) cin >> c[i], val.push_back(c[i]);
  for (int i = 1; n - 1 >= i; ++i) {
    if (b[i] > c[i]) {
      cout << -1;
      return 0;
    }
  }
  sort(val.begin(), val.end());
  val.erase(unique(val.begin(), val.end()), val.end());
  for (int i = 0; (int)val.size() > i; ++i) mapa[val[i]] = i, odp[i] = val[i];
  for (int i = 1; n - 1 >= i; ++i) {
    b[i] = mapa[b[i]];
    c[i] = mapa[c[i]];
    v[b[i]].push_back({c[i], i});
    v[c[i]].push_back({b[i], i});
  }
  bool ok = Epath((int)val.size(), v, odw, ans);
  if (!ok || (int)ans.size() < n) {
    cout << -1;
  } else {
    for (auto it : ans) cout << odp[it] << " ";
  }
  return 0;
}
