#include <bits/stdc++.h>
using namespace std;
size_t where[200005];
void visit(const vector<vector<int>> &G, vector<map<int, int>> &adj, int s,
           vector<int> &path) {
  for (auto &i = where[s]; i < G[s].size(); ++i) {
    int v = G[s][i];
    if (adj[s][v]) {
      --adj[s][v], --adj[v][s];
      visit(G, adj, v, path);
    }
  }
  path.push_back(s);
}
bool euler_path(const vector<vector<int>> &G, vector<int> &path, int s = 0) {
  int n = G.size(), odd = 0, m = 0;
  for (int i = 0; i < n; ++i) {
    odd += G[i].size() & 1;
    m += G[i].size();
  }
  for (int i = 0; i < n; ++i)
    if (G[i].size() % 2 == 1) s = i;
  if (odd == 0 || (odd == 2 && G[s].size() % 2 == 1)) {
    vector<map<int, int>> adj(n);
    for (int u = 0; u < n; ++u)
      for (auto v : G[u]) ++adj[u][v];
    visit(G, adj, s, path);
    reverse(path.begin(), path.end());
    return path.size() == m / 2 + 1;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a, b(n - 1), c(n - 1);
  for (auto &i : b) cin >> i, a.push_back(i);
  for (auto &i : c) cin >> i, a.push_back(i);
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  auto get = [&](int x) {
    return lower_bound(a.begin(), a.end(), x) - a.begin();
  };
  vector<vector<int>> adj(a.size());
  for (int i = 0; i < n - 1; ++i) {
    int u = get(b[i]);
    int v = get(c[i]);
    if (u > v) {
      cout << "-1\n";
      return 0;
    }
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  vector<int> path;
  if (!euler_path(adj, path)) {
    cout << "-1\n";
    return 0;
  }
  for (auto &i : path) cout << a[i] << " \n"[&i == &path.back()];
  return 0;
}
