#include <bits/stdc++.h>
using namespace std;
map<int, int> M;
queue<int> Q[200002];
int n, idt, dep, b[200002], c[200002], d[200002], sta[200002], rea[200002];
int to[200002], e[200002];
inline void add(int x, int y) {
  to[idt++] = y;
  Q[x].push(idt - 1);
}
void dfs(int u) {
  int x;
  while (!Q[u].empty()) {
    x = Q[u].front();
    Q[u].pop();
    if (e[x] || e[x ^ 1]) continue;
    e[x] = e[x ^ 1] = 1;
    dfs(to[x]);
    sta[++dep] = to[x];
  }
}
int main() {
  scanf("%d\n", &n);
  for (int i = 1; i < n; ++i) scanf("%d", b + i);
  for (int i = 1; i < n; ++i) scanf("%d", c + i);
  int cnt = 0;
  int tx, ty, x, y;
  for (int i = 1; i < n; ++i) {
    x = b[i];
    y = c[i];
    if (x > y) return printf("-1"), 0;
    if (!M.count(x))
      M[x] = tx = ++cnt, rea[cnt] = x;
    else
      tx = M[x];
    if (!M.count(y))
      M[y] = ty = ++cnt, rea[cnt] = y;
    else
      ty = M[y];
    add(tx, ty), add(ty, tx);
    d[tx]++;
    d[ty]++;
  }
  int root = 1, sum = 0;
  for (int i = 1; i <= cnt; ++i)
    if (d[i] & 1) sum++, root = i;
  if (sum == 0 || sum == 2) {
    dfs(root);
    sta[++dep] = root;
    if (dep < n) return printf("-1"), 0;
    for (int i = dep; i >= 1; --i) printf("%d ", rea[sta[i]]);
  } else
    printf("-1");
  return 0;
}
