#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int n, m, cnt, tot, head[N], a[N], b[N], c[N], w[N], vis[N], du[N];
map<int, int> id;
struct node {
  int v, nextt;
} e[N << 1];
void addedge(int u, int v) {
  e[++cnt].v = v;
  e[cnt].nextt = head[u];
  head[u] = cnt;
  du[u]++;
  e[++cnt].v = u;
  e[cnt].nextt = head[v];
  head[v] = cnt;
  du[v]++;
}
int getid(int x) {
  if (!id[x]) w[id[x] = ++tot] = x;
  return id[x];
}
void dfs(int u) {
  for (int &i = head[u]; i; i = e[i].nextt) {
    if (!vis[i >> 1]) vis[i >> 1] = 1, dfs(e[i].v);
  }
  a[++m] = u;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) scanf("%d", &b[i]);
  for (int i = 1; i < n; i++) scanf("%d", &c[i]);
  cnt = 1;
  for (int i = 1; i < n; i++)
    if (b[i] > c[i]) {
      puts("-1");
      return 0;
    } else
      addedge(getid(b[i]), getid(c[i]));
  int S = 1, num = 0;
  for (int i = 1; i <= tot; i++)
    if (du[i] & 1) S = i, num++;
  if (num && num != 2) {
    puts("-1");
    return 0;
  }
  dfs(S);
  if (m != n) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) printf("%d ", w[a[i]]);
  return 0;
}
