#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> s;
multiset<int> adj[N];
map<int, int> mp;
int val[N];
int b[N];
int c[N];
int n, node, st, en;
void dfs(int u) {
  while (adj[u].size()) {
    int v = *adj[u].begin();
    adj[u].erase(adj[u].find(v));
    adj[v].erase(adj[v].find(u));
    dfs(v);
  }
  s.push_back(u);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  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]) return cout << -1, 0;
    if (!mp.count(b[i])) {
      mp[b[i]] = ++node;
      val[node] = b[i];
    }
    if (!mp.count(c[i])) {
      mp[c[i]] = ++node;
      val[node] = c[i];
    }
    int u = mp[b[i]];
    int v = mp[c[i]];
    adj[u].insert(v);
    adj[v].insert(u);
    if (node > n) return cout << -1, 0;
  }
  for (int i = 1; i <= node; i++) {
    if (adj[i].size() & 1) {
      if (st == 0)
        st = i;
      else if (en == 0)
        en = i;
      else
        return cout << -1, 0;
    }
  }
  if (st > 0 && en == 0) return cout << -1, 0;
  if (st == 0) st = en = 1;
  dfs(st);
  if (s.size() < n)
    cout << -1;
  else {
    for (int i : s) cout << val[i] << " ";
  }
  return 0;
}
