#include <bits/stdc++.h>
using namespace std;
inline long long gi() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
void bye() {
  puts("-1");
  exit(0);
}
long long ncase = 1;
const int mxn = 1e5 + 5;
long long N, M;
string str;
int A[mxn], B[mxn];
vector<int> C, ans;
vector<pair<int, int> > G[mxn * 2];
void pre() { return; }
void init() {
  N = gi() - 1;
  for (int i = 0; i < N; ++i) C.push_back(A[i] = gi());
  for (int i = 0; i < N; ++i) C.push_back(B[i] = gi());
  for (int i = 0; i < N; ++i)
    if (A[i] > B[i]) bye();
}
bitset<2 * mxn> used;
int mi[2 * mxn];
void dfs(int n) {
  for (int &i = mi[n]; i < G[n].size(); ++i) {
    if (used[G[n][i].second]) continue;
    used[G[n][i].second] = 1;
    dfs(G[n][i].first);
  }
  ans.push_back(n);
}
void sol() {
  sort((C).begin(), (C).end());
  C.resize(unique((C).begin(), (C).end()) - C.begin());
  int sz = C.size();
  for (int i = 0; i < N; ++i)
    A[i] = lower_bound((C).begin(), (C).end(), A[i]) - C.begin();
  for (int i = 0; i < N; ++i)
    B[i] = lower_bound((C).begin(), (C).end(), B[i]) - C.begin();
  for (int i = 0; i < N; ++i) {
    G[A[i]].push_back({B[i], i});
    G[B[i]].push_back({A[i], i});
  }
  int st = 0, odd = 0;
  for (int i = 0; i < sz; ++i)
    if (G[i].size() & 1) st = i, ++odd;
  if (odd > 2) bye();
  dfs(st);
  if (ans.size() != N + 1) bye();
  for (int i : ans) printf("%d ", C[i]);
  puts("");
  return;
}
int main() {
  pre();
  while (ncase--) {
    init();
    sol();
  }
}
