#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, head[N], v[N * 2], nxt[N * 2], ptr, b[N], c[N], deg[N], w[N * 2];
void add_edge(int uu, int vv) {
  v[ptr] = vv;
  nxt[ptr] = head[uu];
  head[uu] = ptr++;
  ++deg[vv];
}
vector<int> num, ans;
void dfs(int pos) {
  for (int &i = head[pos]; i != -1; i != -1 ? i = nxt[i] : i = -1) {
    if (w[i]) continue;
    w[i] = w[i ^ 1] = 1;
    dfs(v[i]);
  }
  ans.push_back(pos);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) cin >> b[i];
  for (int i = 1; i < n; i++) cin >> c[i];
  for (int i = 1; i < n; i++) {
    if (b[i] > c[i]) {
      puts("-1");
      return 0;
    }
    num.push_back(b[i]);
    num.push_back(c[i]);
  }
  sort(num.begin(), num.end());
  num.erase(unique(num.begin(), num.end()), num.end());
  if (num.size() > n) {
    puts("-1");
    return 0;
  }
  memset(head, -1, sizeof(head));
  memset(nxt, -1, sizeof(nxt));
  for (int i = 1; i < n; i++) {
    b[i] = lower_bound(num.begin(), num.end(), b[i]) - num.begin();
    c[i] = lower_bound(num.begin(), num.end(), c[i]) - num.begin();
    add_edge(b[i], c[i]);
    add_edge(c[i], b[i]);
  }
  int start = -1, cnt = 0;
  for (int i = 0; i < num.size(); i++)
    if (deg[i] % 2) {
      ++cnt;
      if (start == -1) start = i;
    }
  if (cnt && cnt != 2) {
    puts("-1");
    return 0;
  }
  if (start == -1) start = 0;
  dfs(start);
  if (ans.size() != n) {
    puts("-1");
    return 0;
  }
  for (auto &i : ans) cout << num[i] << ' ';
  return 0;
}
