#include <bits/stdc++.h>
using namespace std;
int n, cnt;
int val[200005];
map<int, int> mp;
int vis[200005];
stack<int> s;
multiset<int> v[200005];
void dfs(int node) {
  vis[node] = 1;
  while (((int)v[node].size())) {
    int go = *v[node].begin();
    v[node].erase(v[node].begin());
    v[go].erase(v[go].find(node));
    dfs(go);
  }
  s.push(node);
}
int main() {
  scanf("%d", &n);
  vector<int> a(n + 1), b(n + 1);
  for (int i = 1; i < n; i++) {
    scanf("%d", &a[i]);
    if (!mp[a[i]]) {
      mp[a[i]] = ++cnt;
      val[cnt] = a[i];
    }
  }
  for (int i = 1; i < n; i++) {
    scanf("%d", &b[i]);
    if (!mp[b[i]]) {
      mp[b[i]] = ++cnt;
      val[cnt] = b[i];
    }
    if (b[i] < a[i]) {
      printf("-1");
      return 0;
    }
    v[mp[a[i]]].insert(mp[b[i]]);
    v[mp[b[i]]].insert(mp[a[i]]);
  }
  vector<int> odd;
  for (int i = 1; i <= cnt; i++) {
    if (((int)v[i].size()) & 1) odd.push_back(i);
  }
  if (((int)odd.size()) > 2) {
    printf("-1");
    return 0;
  }
  if (!((int)odd.size())) odd.push_back(1);
  dfs(odd[0]);
  for (int i = 1; i <= cnt; i++) {
    if (!vis[i]) {
      printf("-1");
      return 0;
    }
  }
  while (((int)s.size())) {
    printf("%d ", val[s.top()]);
    s.pop();
  }
}
