#include <bits/stdc++.h>
struct Edge {
  int u, v, id;
  Edge(int u, int v, int id) : u(u), v(v), id(id) {}
};
int b[100005], c[100005];
int map[200005];
std::vector<Edge> g[200005];
int in[200005];
int queue[200005];
int path[100005];
int used[100005];
int p[200005];
struct test {
  int l, r;
  test() {}
  test(int l, int r) : l(l), r(r) {}
};
test keep[100005];
test gen[100005];
int getId(int u, int n) {
  int L = 1, R = n;
  int res = -1;
  while (L <= R) {
    int M = (L + R) / 2;
    if (map[M] <= u) {
      res = M;
      L = M + 1;
    } else
      R = M - 1;
  }
  return res;
}
int preWork(int n, int m) {
  std::sort(map + 1, map + 1 + n);
  int p = 1, size = 0;
  while (p <= n) {
    int np = p;
    while (np + 1 <= n && map[np + 1] == map[p]) np++;
    map[++size] = map[p];
    p = np + 1;
  }
  for (int i = 1; i <= m; i++) {
    b[i] = getId(b[i], size);
    c[i] = getId(c[i], size);
  }
  return size;
}
int find(int u) {
  if (p[u] == u)
    return u;
  else
    return p[u] = find(p[u]);
}
void addEdge(int u, int v, int total) {
  p[find(u)] = find(v);
  in[u]++, in[v]++;
  g[u].push_back(Edge(u, v, total));
  g[v].push_back(Edge(v, u, total));
}
void popEdge(int u) {
  while (g[u].size() != 0) {
    int id = g[u][g[u].size() - 1].id;
    if (used[id])
      g[u].pop_back();
    else
      break;
  }
}
int findEuler(int s) {
  int t = -1, size = 0;
  queue[++t] = s;
  while (t != -1) {
    int u = queue[t--];
    popEdge(u);
    if (g[u].size() == 0)
      path[++size] = u;
    else {
      queue[++t] = u;
      Edge edge = g[u][g[u].size() - 1];
      g[u].pop_back();
      used[edge.id] = 1;
      queue[++t] = edge.v;
    }
  }
  return size;
}
int isEuler(int n) {
  int root = find(1);
  for (int i = 2; i <= n; i++)
    if (find(i) != root) return 0;
  int odd = 0, find = -1;
  for (int i = 1; i <= n; i++) {
    if (in[i] % 2) odd++, find = i;
  }
  if (odd == 0)
    return findEuler(1);
  else if (odd == 2)
    return findEuler(find);
  else
    return 0;
}
int min(int a, int b) { return a > b ? b : a; }
int max(int a, int b) { return a > b ? a : b; }
int checkCmp(test u, test v) {
  if (u.l != v.l)
    return u.l < v.l;
  else
    return u.r < v.r;
}
int isOk(int n, int m) {
  if (n != m)
    return 0;
  else {
    std::sort(keep + 1, keep + 1 + n, checkCmp);
    std::sort(gen + 1, gen + 1 + n, checkCmp);
    int ok = 1;
    for (int i = 1; i <= n; i++) {
      if (keep[i].l != gen[i].l || keep[i].r != gen[i].r) ok = 0;
    }
    return ok;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  int size = 0;
  int ok = 1;
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d", &b[i]);
    map[++size] = b[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d", &c[i]);
    if (c[i] < b[i]) ok = 0;
    map[++size] = c[i];
  }
  int count = preWork(size, n - 1);
  for (int i = 1; i <= count; i++) p[i] = i;
  for (int i = 1; i <= n - 1; i++) {
    addEdge(b[i], c[i], i);
  }
  int res = isEuler(count);
  if (ok && res != 0) {
    for (int i = 1; i <= res; i++) {
      printf("%d ", map[path[i]]);
    }
    printf("\n");
  } else
    printf("-1\n");
  return 0;
}
