#include <bits/stdc++.h>
using namespace std;
int arr[1001000];
int k;
int in[1001000];
vector<int> p[1000100];
int b[1001000];
int c[1001000];
int val[1001000];
map<pair<int, int>, int> rep;
void dfs(int x) {
  int y = val[x];
  while (!p[x].empty()) {
    int t = p[x].back();
    p[x].pop_back();
    if (rep[{x, t}]) {
      rep[{x, t}]--;
      continue;
    }
    rep[{t, x}]++;
    dfs(t);
  }
  arr[k++] = x;
}
int main() {
  int n;
  cin >> n;
  map<int, int> st;
  int num = 0;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &b[i]);
    if (st.count(b[i])) continue;
    st[b[i]] = ++num;
    val[num] = b[i];
  }
  bool ok = 1;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &c[i]);
    if (c[i] < b[i]) {
      ok = 0;
    }
    if (st.count(c[i])) continue;
    st[c[i]] = ++num;
    val[num] = c[i];
  }
  if (!ok) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    p[st[b[i]]].push_back(st[c[i]]);
    p[st[c[i]]].push_back(st[b[i]]);
  }
  int sta = 1, od = 0;
  for (int i = 1; i <= num; i++) {
    if (p[i].size() % 2 == 1) {
      sta = i;
      od++;
    }
  }
  if (od != 2 && od != 0) {
    cout << -1;
    return 0;
  }
  dfs(sta);
  if (k != n) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", val[arr[i]]);
  }
  return 0;
}
