#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int next;
  list<Edge>::iterator reverse_edge;
  Edge(int next) : next(next) {}
};
list<Edge> adj[100005];
vector<int> z;
void find_path(int x) {
  while (adj[x].size()) {
    int y = adj[x].front().next;
    adj[y].erase(adj[x].front().reverse_edge);
    adj[x].pop_front();
    find_path(y);
  }
  z.push_back(x);
}
void add_edge(int a, int b) {
  adj[a].push_front(Edge(b));
  adj[b].push_front(Edge(a));
  adj[a].begin()->reverse_edge = adj[b].begin();
  adj[b].begin()->reverse_edge = adj[a].begin();
}
int main() {
  ios::sync_with_stdio(false);
  int n, b[100005] = {}, c[100005] = {};
  cin >> n;
  for (int i = 1; i < n; i++) cin >> b[i];
  for (int i = 1; i < n; i++) cin >> c[i];
  for (int i = 1; i < n; i++)
    if (b[i] > c[i]) {
      cout << -1;
      return 0;
    }
  int o = 0, p[100005] = {};
  set<int> s;
  map<int, int> m;
  for (int i = 1; i < n; i++) s.insert(b[i]), s.insert(c[i]);
  if (s.size() > n) {
    cout << -1;
    return 0;
  }
  for (int i : s) m[i] = ++o, p[o] = i;
  for (int i = 1; i < n; i++) b[i] = m[b[i]], c[i] = m[c[i]];
  int d[100005] = {}, e = 0, f = 1;
  for (int i = 1; i < n; i++) {
    add_edge(b[i], c[i]);
    d[b[i]]++;
    d[c[i]]++;
  }
  for (int i = 1; i <= n; i++)
    if (d[i] & 1) e++, f = i;
  if (e > 2) {
    cout << -1;
    return 0;
  }
  find_path(f);
  if (z.size() < n) {
    cout << -1;
    return 0;
  }
  for (int i : z) cout << p[i] << ' ';
}
