#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "URDL";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int b[100035], c[100035];
map<int, int> mp;
int cid, val[100035], cc[100035], dg[100035], es;
vector<int> path;
vector<pair<int, int> > mpt[100035];
void adde(int u, int v) {
  es++;
  mpt[u].push_back({v, es});
  mpt[v].push_back({u, es});
  dg[u]++;
  dg[v]++;
}
bool del[100035];
void dfs(int x) {
  while (!mpt[x].empty()) {
    auto it = mpt[x].back();
    mpt[x].pop_back();
    int v = it.first, eid = it.second;
    if (del[eid]) continue;
    del[eid] = 1;
    dfs(v);
  }
  path.push_back(x);
}
vector<int> Ans;
void ppt() {
  if (Ans.size() != n) et();
  for (int z : Ans) printf("%d ", val[z]);
  exit(0);
}
void fmain(int tid) {
  scanf("%d", &n);
  for (int(i) = 1; (i) <= (int)(n - 1); (i)++) scanf("%d", b + i);
  for (int(i) = 1; (i) <= (int)(n - 1); (i)++) scanf("%d", c + i);
  for (int(i) = 1; (i) <= (int)(n - 1); (i)++) {
    if (b[i] > c[i]) et();
    mp[b[i]];
    mp[c[i]];
  }
  for (auto& p : mp) {
    p.second = ++cid;
    val[cid] = p.first;
    if (cid > n) et();
  }
  for (int(i) = 1; (i) <= (int)(n - 1); (i)++) {
    b[i] = mp[b[i]];
    c[i] = mp[c[i]];
    if (b[i] == c[i])
      cc[b[i]]++;
    else
      adde(b[i], c[i]);
  }
  vector<int> odd;
  for (int(i) = 1; (i) <= (int)(cid); (i)++)
    if (dg[i] & 1) odd.push_back(i);
  if (!odd.empty()) {
    if (odd.size() != 2) et();
  }
  if (odd.empty())
    dfs(1);
  else
    dfs(odd[0]);
  for (int z : path) {
    Ans.push_back(z);
    while (cc[z] > 0) {
      cc[z]--;
      Ans.push_back(z);
    }
  }
  ppt();
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
