#include <bits/stdc++.h>
using namespace std;
int n, Cnt = 0, Num = 0;
int l[200000 + 10], r[200000 + 10];
map<int, int> mp;
int Di[200000 + 10];
vector<int> f[200000 + 10], No[200000 + 10];
int cur[200000 + 10];
bool b[200000 + 10];
int Ans[200000 + 10];
int Check() {
  int Now = -1, ODD = 0;
  for (int i = 1; i <= Cnt; i++)
    if (f[i].size() % 2 == 1) {
      ODD++;
      Now = i;
    }
  if (ODD == 2) return Now;
  if (ODD == 0) return 1;
  return -1;
}
void Euler(int x) {
  for (int i = cur[x]; i < f[x].size(); i = cur[x]) {
    cur[x] = i + 1;
    if (b[No[x][i]]) continue;
    b[No[x][i]] = true;
    Euler(f[x][i]);
  }
  Ans[++Ans[0]] = x;
}
int main() {
  scanf("%d", &n);
  n--;
  for (int i = 1; i <= n; i++) scanf("%d", &l[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  int x, y;
  for (int i = 1; i <= n; i++) {
    if (l[i] > r[i]) return printf("-1"), 0;
    if (!mp.count(l[i]))
      x = mp[l[i]] = ++Cnt, Di[Cnt] = l[i];
    else
      x = mp[l[i]];
    if (!mp.count(r[i]))
      y = mp[r[i]] = ++Cnt, Di[Cnt] = r[i];
    else
      y = mp[r[i]];
    Num++;
    f[x].push_back(y);
    No[x].push_back(Num);
    f[y].push_back(x);
    No[y].push_back(Num);
  }
  int Begin = Check();
  if (Begin == -1) return printf("-1"), 0;
  Euler(Begin);
  if (Ans[0] != n + 1) return printf("-1"), 0;
  for (int i = n + 1; i; i--) printf("%d ", Di[Ans[i]]);
  return 0;
}
