#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long gethash(long long a, long long b) {
  if (a < b) swap(a, b);
  return a * N + b;
}
int n = 0, m = 0;
vector<int> g[1000001];
unordered_map<long long, int> del;
vector<int> rk;
int a[1000001];
int b[1000001];
int du[1000001];
stack<int> nodes;
void dfs(int u) {
  while ((int)(g[u]).size()) {
    int v = g[u][0];
    g[u][0] = g[u][(int)(g[u]).size() - 1], g[u].resize((int)(g[u]).size() - 1);
    if (!del[gethash(u, v)]) continue;
    del[gethash(u, v)]--;
    dfs(v);
  }
  nodes.push(u);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) cin >> a[i], rk.push_back(a[i]);
  for (int i = 1; i <= n - 1; i++) cin >> b[i], rk.push_back(b[i]);
  sort(rk.begin(), rk.end()), rk.erase(unique(rk.begin(), rk.end()), rk.end());
  for (int i = 1; i <= n - 1; i++)
    if (a[i] > b[i]) {
      cout << -1;
      return 0;
    }
  for (int i = 1; i <= n - 1; i++) {
    int u = lower_bound(rk.begin(), rk.end(), (a[i])) - rk.begin() + 1;
    int v = lower_bound(rk.begin(), rk.end(), (b[i])) - rk.begin() + 1;
    del[gethash(u, v)]++;
    g[u].push_back(v);
    g[v].push_back(u);
    du[u]++;
    du[v]++;
  }
  int s = -1;
  int odd = 0;
  for (int x = 1; x <= (int)(rk).size(); x++) {
    if (du[x] & 1) {
      odd++;
      if (s == -1) s = x;
    }
  }
  if (odd == 0)
    s = 1;
  else if (odd != 2) {
    cout << -1;
    return 0;
  }
  dfs(s);
  if ((int)(nodes).size() != n) {
    cout << -1;
    return 0;
  }
  while (!nodes.empty()) {
    cout << rk[nodes.top() - 1] << ' ';
    nodes.pop();
  }
}
