#include <bits/stdc++.h>
bool debug = 1;
const long long MOD = 1000000007;
const double PI = acos(-1.0);
const double eps = 1e-9;
using namespace std;
struct eulerianGraph {
  int n, m;
  int eulerian;
  vector<vector<pair<int, int> > > adj;
  vector<int> odd;
  eulerianGraph(int n) : n(n), m(0), eulerian(-1) {
    adj.resize(n + 1);
    for (int i = (0); i < (n + 1); i++) adj[i] = vector<pair<int, int> >();
  }
  void addEdge(int a, int b) {
    adj[a].push_back({b, m});
    adj[b].push_back({a, m});
    m++;
  }
  bool isEulerian() {
    if (eulerian != -1) return eulerian;
    for (int i = (0); i < (n + 1); i++) {
      if (adj[i].size() % 2 == 1) {
        odd.push_back(i);
        if (odd.size() > 2) return eulerian = 0;
      }
    }
    if (odd.size() == 1) return eulerian = 0;
    return eulerian = isConnected();
  }
  void addPlaceholderEdge() {
    if (odd.size() == 0) return;
    addEdge(odd[0], odd[1]);
  }
  void removePlaceholderEdge() {
    if (odd.size() == 0) return;
    m--;
    adj[odd[0]].pop_back();
    adj[odd[1]].pop_back();
  }
  vector<int> findEuler() {
    if (isEulerian() == 0) return vector<int>();
    addPlaceholderEdge();
    vector<bool> used(m, 0);
    vector<int> r, cur(n + 1, 0);
    int first = 0;
    while (adj[first].size() == 0) first++;
    findEulerRec(first, r, used, cur);
    removePlaceholderEdge();
    if (odd.size() > 0) {
      int v1 = odd[0], v2 = odd[1];
      for (int i = (0); i < (r.size() - 1); i++) {
        if ((r[i] == v1 && r[i + 1] == v2) || (r[i] == v2 && r[i + 1] == v1)) {
          vector<int> r2;
          for (int j = (i + 1); j < (r.size()); j++) r2.push_back(r[j]);
          for (int j = (1); j < (i + 1); j++) r2.push_back(r[j]);
          r = r2;
          break;
        }
      }
    }
    return r;
  }

 private:
  bool isConnected() {
    vector<bool> vis(n + 1, 0);
    stack<int> p;
    int first = 0;
    while (adj[first].size() == 0) first++;
    p.push(first);
    vis[first] = 1;
    while (!p.empty()) {
      int u = p.top();
      p.pop();
      for (auto v : adj[u]) {
        if (vis[v.first] == 0) {
          p.push(v.first);
          vis[v.first] = 1;
        }
      }
    }
    for (int i = (0); i < (n + 1); i++)
      if (adj[i].size() > 0 && vis[i] == 0) return 0;
    return 1;
  }
  void findEulerRec(int v, vector<int> &r, vector<bool> &used,
                    vector<int> &cur) {
    int &i = cur[v];
    for (; i < adj[v].size(); i++) {
      if (used[adj[v][i].second]) continue;
      used[adj[v][i].second] = 1;
      int u = adj[v][i].first;
      i++;
      findEulerRec(u, r, used, cur);
    }
    r.push_back(v);
  }
};
int b[100100], c[100100];
map<int, int> dic, dic2;
int cnt = 0;
void addDic(int x) {
  if (dic.find(x) == dic.end()) {
    dic[x] = cnt;
    dic2[cnt] = x;
    cnt++;
  }
}
void fail() {
  printf("-1\n");
  exit(0);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (0); i < (n - 1); i++) {
    scanf("%d", &b[i]);
    addDic(b[i]);
  }
  for (int i = (0); i < (n - 1); i++) {
    scanf("%d", &c[i]);
    addDic(c[i]);
  }
  eulerianGraph g(cnt);
  for (int i = (0); i < (n - 1); i++) {
    if (c[i] < b[i]) fail();
    g.addEdge(dic[b[i]], dic[c[i]]);
  }
  if (!g.isEulerian()) fail();
  vector<int> r = g.findEuler();
  for (int i = (0); i < (r.size()); i++) {
    r[i] = dic2[r[i]];
  }
  for (int x : r) {
    printf("%d ", x);
  }
  cout << endl;
  return 0;
}
