#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int b[N], c[N], p[N], x[N << 1], nx;
int n;
struct Edge {
  int v, w, nxt;
} e[N << 1];
int head[N << 1], cnt, cur[N << 1];
void add(int u, int v, int w) {
  e[cnt] = (Edge){v, w, head[u]};
  head[u] = cnt++;
}
int getid(int a) { return lower_bound(x + 1, x + nx + 1, a) - x; }
vector<int> ans;
bool vis[N << 1];
void dfs(int u) {
  for (int &i = cur[u]; ~i; i = e[i].nxt) {
    Edge e1 = e[i];
    if (vis[e1.w]) continue;
    vis[e1.w] = 1;
    dfs(e1.v);
    ans.push_back(e1.v);
    if (i == -1) break;
  }
}
int d[N << 1];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  memset(head, -1, sizeof(head));
  for (int i = 1; i < n; i++) cin >> b[i], x[++nx] = b[i];
  for (int i = 1; i < n; i++) cin >> c[i], x[++nx] = c[i];
  sort(x + 1, x + nx + 1);
  nx = unique(x + 1, x + nx + 1) - x - 1;
  for (int i = 1; i < n; i++) {
    b[i] = getid(b[i]), c[i] = getid(c[i]);
    if (b[i] > c[i]) {
      cout << -1 << endl;
      return 0;
    }
  }
  for (int i = 1; i < n; i++)
    add(b[i], c[i], i), add(c[i], b[i], i), d[c[i]]++, d[b[i]]++;
  for (int i = 1; i <= nx; i++) cur[i] = head[i];
  int st = 1;
  int js = 0;
  for (int i = 1; i <= nx; i++) {
    js += (d[i] % 2);
    if (d[i] % 2) st = i;
  }
  if (js != 2 && js != 0) {
    cout << -1 << endl;
    return 0;
  }
  dfs(st);
  if (ans.size() != n - 1) {
    cout << -1 << endl;
    return 0;
  }
  for (auto i : ans) cout << x[i] << " ";
  cout << x[st] << endl;
  return 0;
}
