#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int b[N], c[N], it[N];
vector<int> vec, ans;
vector<pair<int, int> > adj[N];
bool mark[N];
int n, t, s;
int id(int x) { return lower_bound(vec.begin(), vec.end(), x) - vec.begin(); }
void dfs(int v) {
  while (it[v] < adj[v].size()) {
    auto [u, i] = adj[v][it[v]++];
    if (!mark[i]) {
      mark[i] = true;
      dfs(u);
    }
  }
  ans.push_back(v);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> b[i];
    vec.push_back(b[i]);
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> c[i];
    vec.push_back(c[i]);
  }
  sort(vec.begin(), vec.end());
  vec.resize(distance(vec.begin(), unique(vec.begin(), vec.end())));
  for (int i = 0; i < n - 1; i++) {
    if (c[i] < b[i]) return cout << -1, 0;
    int v = id(b[i]);
    int u = id(c[i]);
    adj[v].push_back({u, t});
    adj[u].push_back({v, t++});
  }
  int tmp = 0;
  for (int i = 0; i < t; i++)
    if ((int)adj[i].size() % 2) {
      s = i;
      tmp++;
    }
  if (tmp > 2) return cout << -1, 0;
  dfs(s);
  if (ans.size() < n) return cout << -1, 0;
  for (auto x : ans) cout << vec[x] << " ";
}
