#include <bits/stdc++.h>
using namespace std;
void euler(long long v, vector<long long> &circuit,
           map<long long, map<long long, int>> &adj) {
  while (!adj[v].empty()) {
    long long u = adj[v].begin()->first;
    adj[v][u]--;
    adj[u][v]--;
    if (adj[v][u] == 0) adj[v].erase(u);
    if (adj[u][v] == 0) adj[u].erase(v);
    euler(u, circuit, adj);
  }
  circuit.push_back(v);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  long long b[n - 1], c[n - 1];
  for (int i = 0; i < n - 1; ++i) cin >> b[i];
  for (int i = 0; i < n - 1; ++i) {
    cin >> c[i];
  }
  bool flag = true;
  for (int i = 0; flag && i < n - 1; ++i)
    if (b[i] > c[i]) flag = false;
  if (!flag) {
    cout << -1;
    return 0;
  }
  map<long long, map<long long, int>> adj;
  map<long long, int> deg;
  for (int i = 0; i < n - 1; ++i) {
    adj[b[i]][c[i]]++;
    adj[c[i]][b[i]]++;
    deg[c[i]]++;
    deg[b[i]]++;
  }
  map<long long, bool> visited;
  for (int i = 0; i < n - 1; ++i) visited[b[i]] = visited[c[i]] = false;
  stack<long long> dfs;
  dfs.push(b[0]);
  while (!dfs.empty()) {
    long long v = dfs.top();
    dfs.pop();
    visited[v] = true;
    for (auto pp : adj[v]) {
      long long u = pp.first;
      if (!visited[u]) {
        dfs.push(u);
      }
    }
  }
  flag = true;
  for (int i = 0; flag && i < n - 1; ++i)
    if (!visited[b[i]] || !visited[c[i]]) flag = false;
  if (!flag) {
    cout << -1;
    return 0;
  }
  int r[2] = {-1, -1}, rlen = 0;
  for (auto pp : deg) {
    if (pp.second % 2 != 0) {
      rlen++;
      if (rlen <= 2) r[rlen - 1] = pp.first;
    }
  }
  if (rlen != 0 && rlen != 2) {
    cout << -1;
    return 0;
  }
  vector<long long> circuit;
  if (rlen == 0)
    euler(b[0], circuit, adj);
  else
    euler(r[0], circuit, adj);
  for (long long v : circuit) {
    cout << v << ' ';
  }
  return 0;
}
