#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T>
inline void read(T &x) {
  char c;
  bool nega = 0;
  while ((!isdigit(c = getchar())) && (c != '-'))
    ;
  if (c == '-') {
    nega = 1;
    c = getchar();
  }
  x = c - 48;
  while (isdigit(c = getchar())) x = x * 10 + c - 48;
  if (nega) x = -x;
}
template <typename T>
inline void writep(T x) {
  if (x > 9) writep(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  writep(x);
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
int v[100001];
int b[100001];
int c[100001];
int x[100001];
int n, m;
map<int, int> M;
vector<int> g[100001];
bool done[100001];
deque<int> path;
void dfs(int u) {
  if ((!path.empty()) && (path.front() == u)) return;
  while (true) {
    while ((!g[u].empty()) && (done[g[u].back()])) g[u].pop_back();
    if (g[u].empty()) return;
    path.push_back(u);
    int v = x[g[u].back()] ^ u;
    done[g[u].back()] = 1;
    dfs(v);
    path.push_front(u);
    path.pop_back();
  }
}
void check() {
  int x;
  multiset<pair<int, int>> s;
  for (int i = (0); i < (n - 1); i++) {
    s.insert(make_pair(min(path[i], path[i + 1]), max(path[i], path[i + 1])));
  }
  for (int i = (1); i < (n); i++) {
    if (s.find(make_pair(b[i], c[i])) == s.end()) exit(-4);
    s.erase(s.find(make_pair(b[i], c[i])));
  }
}
void find_euler_path() {
  vector<int> odd;
  for (int i = (1); i <= (m); i++)
    if (g[i].size() % 2) odd.push_back(i);
  if (odd.size()) {
    assert(odd.size() == 2);
    b[n] = odd[0];
    c[n] = odd[1];
    x[n] = b[n] ^ c[n];
    g[odd[0]].push_back(n);
    g[odd[1]].push_back(n);
  } else
    done[n] = 1;
  dfs(1);
  for (int i = (1); i <= (n); i++)
    if (!done[i]) {
      puts("-1");
      exit(0);
    }
  if (odd.size()) {
    while (!(((path[0] == b[n]) && (path[1] == c[n])) ||
             ((path[1] == b[n]) && (path[0] == c[n])))) {
      path.push_back(path.front());
      path.pop_front();
    }
    path.push_back(path.front());
    path.pop_front();
  } else
    path.push_back(path.front());
}
int main() {
  read(n);
  for (int i = (1); i < (n); i++) {
    read(b[i]);
    M[b[i]] = 1;
  }
  for (int i = (1); i < (n); i++) {
    read(c[i]);
    M[c[i]] = 1;
  }
  for (int i = (1); i < (n); i++)
    if (b[i] > c[i]) {
      puts("-1");
      return 0;
    }
  if (M.size() > n) {
    puts("-1");
    return 0;
  }
  for (auto &c : M) {
    m++;
    c.second = m;
    v[m] = c.first;
  }
  for (int i = (1); i < (n); i++) b[i] = M[b[i]];
  for (int i = (1); i < (n); i++) c[i] = M[c[i]];
  for (int i = (1); i < (n); i++) {
    x[i] = b[i] ^ c[i];
    g[b[i]].push_back(i);
    g[c[i]].push_back(i);
  }
  int odd_cnt = 0;
  for (int i = (1); i <= (m); i++) odd_cnt += g[i].size() % 2;
  if (odd_cnt > 2) {
    puts("-1");
    return 0;
  }
  find_euler_path();
  for (auto &x : path) {
    write(v[x]);
    putchar(' ');
  }
}
