#include <bits/stdc++.h>
using namespace std;
int n, in, nod;
int b[200010];
int c[200010];
int it[200010];
int kika2[200010];
pair<int, int> arr[200010];
vector<vector<int> > grafo;
bitset<200010> vis, vis2;
vector<int> res;
map<int, int> kika;
void dfs(int u) {
  if (!vis2[u]) {
    vis2[u] = true;
    nod++;
  }
  int ar, v, total;
  total = grafo[u].size();
  for (; it[u] < total; ++it[u]) {
    ar = grafo[u][it[u]];
    if (!vis[ar]) {
      v = arr[ar].second + arr[ar].first - u;
      vis[ar] = true;
      dfs(v);
    }
  }
  res.push_back(u);
}
bool comp(int a, int b) { return a > b; }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  grafo.assign(200010, vector<int>());
  for (int i = 0; i < n - 1; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    cin >> c[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    if (b[i] > c[i]) {
      cout << "-1\n";
      return 0;
    }
  }
  int cont = 1, in1, in2;
  for (int i = 0; i < n - 1; ++i) {
    if (!kika[b[i]]) {
      kika[b[i]] = cont++;
    }
    if (!kika[c[i]]) {
      kika[c[i]] = cont++;
    }
    in1 = kika[b[i]];
    in2 = kika[c[i]];
    kika2[in1] = b[i];
    kika2[in2] = c[i];
    arr[in] = {in1, in2};
    grafo[in1].push_back(in);
    grafo[in2].push_back(in);
    in++;
  }
  cont = 0;
  int ind = 1;
  for (auto x : kika) {
    if ((int)(grafo[x.second].size()) & 1) {
      ind = x.second;
      cont++;
    }
  }
  if (cont != 0 && cont != 2) {
    cout << "-1\n";
    return 0;
  }
  res.reserve(200010);
  dfs(ind);
  if (nod != (int)kika.size()) {
    cout << "-1\n";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    cout << kika2[res[i]] << " ";
  }
  cout << "\n";
  return 0;
}
