#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll p = 1000000007;
void rem(unordered_map<ll, unordered_map<ll, ll>> &graph, ll fr, ll to) {
  graph[fr][to]--;
  graph[to][fr]--;
  if (graph[fr][to] == 0) {
    graph[fr].erase(to);
    if (fr != to) graph[to].erase(fr);
  }
}
void show_graph(unordered_map<ll, unordered_map<ll, ll>> &graph) {
  for (auto &el : graph) {
    cout << el.first << ":";
    for (auto &el2 : el.second) {
      cout << " " << el2.first;
    }
    cout << endl;
  }
}
void euler_path(unordered_map<ll, unordered_map<ll, ll>> &graph,
                list<ll> &route, ll fr, ll count) {
  vector<bool> was(count, false);
  was[fr] = true;
  vector<list<ll>::iterator> stack = {route.begin()};
  auto it = route.begin();
  it++;
  bool first = true;
  ;
  while (!stack.empty()) {
    auto it = stack.back();
    stack.pop_back();
    if (first) {
      first = false;
      stack.push_back(it);
    }
    fr = *it;
    it++;
    while (!graph[fr].empty()) {
      auto el = *graph[fr].begin();
      ll to = el.first;
      it = route.emplace(it, to);
      if (!was[to]) {
        was[to] = true;
        stack.push_back(it);
      }
      it++;
      rem(graph, fr, to);
      fr = to;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll n;
  cin >> n;
  vector<ll> bis(n - 1), cis(n - 1), vboth;
  unordered_set<ll> sboth;
  unordered_map<ll, ll> mcounts, rev;
  for (int i = 0; i < n - 1; ++i) {
    cin >> bis[i];
    mcounts[bis[i]]++;
    sboth.insert(bis[i]);
  }
  for (int i = 0; i < n - 1; ++i) {
    cin >> cis[i];
    mcounts[cis[i]]++;
    sboth.insert(cis[i]);
  }
  for (int i = 0; i < n - 1; ++i) {
    if (bis[i] > cis[i]) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (const auto &el : sboth) {
    vboth.emplace_back(el);
  }
  sort(vboth.begin(), vboth.end());
  for (int i = 0; i < vboth.size(); i++) {
    rev[vboth[i]] = i;
  }
  unordered_map<ll, unordered_map<ll, ll>> graph;
  for (int i = 0; i < n - 1; ++i) {
    ll fr = rev[bis[i]], to = rev[cis[i]];
    graph[fr][to]++;
    graph[to][fr]++;
  }
  set<ll> odds;
  for (const auto &el : mcounts) {
    if (el.second % 2 == 1) odds.insert(rev[el.first]);
  }
  if (odds.size() != 2 && odds.size() != 0) {
    cout << -1 << endl;
    return 0;
  }
  list<ll> route;
  ll start = odds.empty() ? 0ll : *odds.begin();
  route.emplace_back(start);
  euler_path(graph, route, start, vboth.size());
  if (route.size() != n) {
    cout << -1 << endl;
  } else {
    for_each(route.begin(), route.end(), [&vboth](ll &el) { el = vboth[el]; });
    for (const auto &el : route) cout << " " << el;
    cout << endl;
  }
  return 0;
}
