#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T lowbit(T x) {
  return x & (-x);
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
inline T Pow(T a, T b, T p) {
  T ret = 1;
  a %= p;
  for (; b; b >>= 1, a = a * a % p)
    if (b & 1) (ret *= a) %= p;
  return ret;
}
template <class T>
inline void read(T &ret) {
  T x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  ret = x * f;
}
const int N = 2e5 + 10;
struct edge {
  int v, nxt;
  bool flg;
} g[N * 2];
int head[N], sz = 1;
void add(int u, int v) {
  g[++sz].v = v;
  g[sz].flg = 1;
  g[sz].nxt = head[u];
  head[u] = sz;
}
vector<int> a;
int n, m, b[N], c[N];
void disc() {
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  for (int i = (1); i <= (n - 1); i++) {
    b[i] = lower_bound(a.begin(), a.end(), b[i]) - a.begin() + 1;
    c[i] = lower_bound(a.begin(), a.end(), c[i]) - a.begin() + 1;
  }
  m = a.size();
}
int deg[N], cir[N];
int seq[N], top = 0;
vector<int> sta;
void dfs(int u) {
  while (head[u]) {
    int i = head[u];
    head[u] = g[i].nxt;
    if (g[i].flg) {
      g[i].flg = g[i ^ 1].flg = 0;
      dfs(g[i].v);
    }
  }
  seq[++top] = u;
}
int main() {
  read(n);
  for (int i = (1); i <= (n - 1); i++) {
    read(b[i]);
    a.push_back(b[i]);
  }
  for (int i = (1); i <= (n - 1); i++) {
    read(c[i]);
    a.push_back(c[i]);
    if (c[i] < b[i]) {
      printf("-1");
      return 0;
    }
  }
  disc();
  if (m == 1) {
    for (int i = (1); i <= (n); i++) printf("%d ", b[1]);
    return 0;
  }
  for (int i = (1); i <= (n - 1); i++) {
    add(b[i], c[i]);
    add(c[i], b[i]);
    deg[c[i]]++;
    deg[b[i]]++;
  }
  for (int i = (1); i <= (m); i++)
    if (deg[i] % 2) sta.push_back(i);
  if (sta.size() == 2)
    dfs(sta[0]);
  else if (sta.size() == 0)
    dfs(1);
  else {
    printf("-1");
    return 0;
  }
  if (top != n) {
    printf("-1");
    return 0;
  }
  for (int i = (1); i <= (top); i++) printf("%d ", a[seq[i] - 1]);
}
