#include <bits/stdc++.h>
using namespace std;
const int maxn = 500100;
map<int, int> id;
int n;
int head[maxn], nxt[maxn << 1], ver[maxn << 1], tot = 1, d[maxn],
                                                vis[maxn << 1];
int vcnt, val[maxn];
int cnt;
inline void addedge(int a, int b) {
  nxt[tot] = head[a];
  ver[tot] = b;
  head[a] = tot++;
  d[a]++;
  nxt[tot] = head[b];
  ver[tot] = a;
  head[b] = tot++;
  d[b]++;
}
struct edge {
  int to, nxt;
} e[1000010];
void add(int u, int v) {
  d[u]++;
  e[cnt].to = v;
  e[cnt].nxt = head[u];
  head[u] = cnt;
}
int ans[maxn], anscnt;
inline void print() {
  for (int i = 1; i <= anscnt; i++) printf("%d ", val[ans[i]]);
  exit(0);
}
inline void dfs(int x) {
  for (; head[x] != -1;) {
    int i = head[x];
    head[x] = nxt[i];
    if (vis[i]) continue;
    int y = ver[i];
    vis[i] = vis[i ^ 1] = 1;
    dfs(y);
  }
  ans[++anscnt] = x;
}
int va[maxn], vb[maxn];
vector<int> tmp;
int main() {
  memset(head, -1, sizeof(head));
  cnt = 0;
  tot = 0;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d", va + i);
  for (int i = 1; i < n; i++) scanf("%d", vb + i);
  for (int i = 1; i < n; i++) {
    int a = va[i], b = vb[i];
    if (a > b) return puts("-1"), 0;
    if (id.count(a) == 0) id[a] = ++vcnt, val[vcnt] = a;
    if (id.count(b) == 0) id[b] = ++vcnt, val[vcnt] = b;
    a = id[a];
    b = id[b];
    addedge(a, b);
  }
  for (int i = 1; i <= n; i++)
    if (d[i] & 1) tmp.push_back(i);
  if (tmp.size() == 0) {
    dfs(1);
    if (anscnt == n) print();
    return puts("-1"), 0;
  }
  if (tmp.size() == 2) {
    dfs(tmp[0]);
    if (anscnt == n) print();
    return puts("-1"), 0;
  }
  puts("-1");
  return 0;
}
