#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> cnt(n);
  vector<set<int>> g(n);
  for (int i = 0; i < 2 * n; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].insert(v);
    g[v].insert(u);
    cnt[v]++;
    cnt[u]++;
  }
  for (auto elem : cnt) {
    if (elem != 4) {
      cout << -1;
      return 0;
    }
  }
  vector<pair<int, int>> tri;
  for (auto u : g[0]) {
    for (auto v : g[0]) {
      if (u != v && g[u].count(v) == 1) {
        tri.push_back({u, v});
      }
    }
  }
  for (auto elem : tri) {
    int v0 = elem.first;
    vector<int> cycle;
    cycle.push_back(0);
    int u0 = elem.second;
    cycle.push_back(v0);
    cycle.push_back(u0);
    vector<int> used(n);
    used[0] = 1;
    used[v0] = 1;
    used[u0] = 1;
    bool ok = true;
    while (ok && cycle.size() < n) {
      ok = false;
      int v1 = -1;
      for (auto u : g[cycle.back()]) {
        if (g[u].count(cycle[cycle.size() - 2]) && used[u] == 0) {
          v1 = u;
          ok = true;
        }
      }
      if (v1 != -1) {
        used[v1] = 1;
        cycle.push_back(v1);
      }
    }
    if (n == cycle.size()) {
      for (auto elem : cycle) {
        cout << elem + 1 << ' ';
      }
      return 0;
    }
  }
  cout << -1;
}
