#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int u, v;
  int other(int x) { return u ^ v ^ x; }
};
struct Eulerpath {
  int n;
  vector<Edge> edges;
  vector<bool> vis;
  vector<vector<int>> adj;
  Eulerpath(int nn) : n(nn), adj(nn) {}
  void addEdge(int u, int v) {
    edges.push_back({u, v});
    vis.push_back(0);
    int id = edges.size() - 1;
    adj[u].push_back(id);
    adj[v].push_back(id);
  }
  bool getTour(vector<int> &path) {
    int u = 0, cnt = 0;
    for (int i = 0; i < n; i++)
      if (adj[i].size() % 2) {
        u = i;
        ++cnt;
      }
    if (cnt != 0 && cnt != 2) return false;
    stack<int> st;
    path.clear();
    while (true) {
      while (adj[u].size() && vis[adj[u].back()] == 1) adj[u].pop_back();
      if (adj[u].empty()) {
        path.push_back(u);
        if (st.empty()) break;
        u = st.top();
        st.pop();
      } else {
        st.push(u);
        int id = adj[u].back();
        vis[id] = 1;
        u = edges[id].other(u);
      }
    }
    for (int i = 0; i < edges.size(); i++)
      if (!vis[i]) return false;
    return true;
  }
};
const int N = 1e5 + 7;
int u[N], v[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  unordered_map<int, int> mp;
  vector<int> invmap(n + 1);
  for (int i = 1; i < n; i++) cin >> u[i];
  for (int i = 1; i < n; i++) cin >> v[i];
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (u[i] > v[i]) {
      cout << -1 << endl;
      return 0;
    }
    if (mp.count(u[i]) == 0) mp[u[i]] = cnt++;
    u[i] = mp[u[i]];
    if (mp.count(v[i]) == 0) mp[v[i]] = cnt++;
    v[i] = mp[v[i]];
  }
  if (cnt > n) {
    cout << -1 << endl;
    return 0;
  }
  for (auto pr : mp) invmap[pr.second] = pr.first;
  Eulerpath solver(n);
  for (int i = 1; i < n; i++) {
    solver.addEdge(u[i], v[i]);
  }
  vector<int> ans;
  bool b = solver.getTour(ans);
  if (!b) {
    cout << -1 << endl;
    return 0;
  }
  for (int x : ans) cout << invmap[x] << " ";
}
