#include <bits/stdc++.h>
using namespace std;
vector<int> vt;
int a[100010], b[100010];
int ch[100010];
int visited[100010];
vector<vector<int>> vt1;
vector<int> dap;
int getidx(int x) { return lower_bound(vt.begin(), vt.end(), x) - vt.begin(); }
int degree[100010];
int oo = 0;
void dfs(int here) {
  int t = getidx(here);
  while (vt1[t].size()) {
    int idx = vt1[t].back();
    vt1[t].pop_back();
    if (visited[idx]) continue;
    visited[idx] = 1;
    int next = a[idx] ^ b[idx] ^ here;
    dfs(next);
  }
  dap.push_back(here);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d", &a[i]);
    vt.push_back(a[i]);
  }
  for (int i = 1; i < n; i++) {
    scanf("%d", &b[i]);
    if (a[i] > b[i]) {
      puts("-1");
      return 0;
    }
    vt.push_back(b[i]);
  }
  sort(vt.begin(), vt.end());
  vt.erase(unique(vt.begin(), vt.end()), vt.end());
  if (vt.size() > n) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i < n; i++) ch[getidx(a[i])]++;
  for (int i = 1; i < n; i++) ch[getidx(b[i])]++;
  int cnt = 0;
  int cc = 0;
  for (int i = 0; i < vt.size(); i++) {
    if (ch[i] % 2) {
      cnt++;
      cc = i;
    }
  }
  vt1.resize(vt.size());
  if (cnt == 0 || cnt == 2) {
    for (int i = 1; i < n; i++) {
      vt1[getidx(a[i])].push_back(i);
      vt1[getidx(b[i])].push_back(i);
    }
    for (int i = 0; i < vt.size(); i++) {
      sort(vt1[i].begin(), vt1[i].end());
      reverse(vt1[i].begin(), vt1[i].end());
    }
    dfs(vt[cc]);
    if (dap.size() != n)
      puts("-1");
    else
      for (int i = 0; i < dap.size(); i++) printf("%d ", dap[i]);
  } else
    puts("-1");
}
