#include <bits/stdc++.h>
using namespace std;
struct nodo {
  long long f, s;
};
long long N, idx, ini, fin;
nodo a[300005];
unordered_map<long long, long long> mp;
unordered_map<long long, long long> invmp;
long long resp[300005];
vector<long long> imp;
vector<long long> ans;
multiset<long long> ady[300005];
void fail() {
  cout << "-1";
  exit(0);
}
void dfs(long long x) {
  while (!ady[x].empty()) {
    int v = *ady[x].begin();
    ady[x].erase(ady[x].find(v));
    ady[v].erase(ady[v].find(x));
    dfs(v);
  }
  ans.push_back(invmp[x]);
}
void check(int x) {
  if (mp[x]) return;
  mp[x] = ++idx;
  invmp[idx] = x;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N;
  for (long long i = 1; i < N; i++) cin >> a[i].f;
  for (long long i = 1; i < N; i++) {
    cin >> a[i].s;
    if (a[i].f > a[i].s) fail();
    check(a[i].f);
    check(a[i].s);
    long long u = mp[a[i].f];
    long long v = mp[a[i].s];
    ady[u].insert(v);
    ady[v].insert(u);
  }
  for (long long i = 1; i <= idx; i++)
    if (ady[i].size() & 1) imp.push_back(i);
  if (imp.size() != 0 && imp.size() != 2) fail();
  if (!imp.size())
    ini = 1;
  else
    ini = imp[0];
  dfs(ini);
  for (int i = 1; i <= idx; i++)
    if (!ady[i].empty()) fail();
  long long pos = 1;
  for (long long i = 0; i < ans.size() - 1; i++) {
    long long f = ans[i];
    long long s = ans[i + 1];
    resp[pos] = f;
    resp[pos + 1] = s;
    pos++;
  }
  for (long long i = 1; i <= N; i++) cout << resp[i] << " ";
  return 0;
}
