#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, set<int> > m;
  for (int Q = 0; Q < 2 * n; ++Q) {
    int x, y;
    cin >> x >> y;
    m[x].insert(y);
    m[y].insert(x);
  }
  if (m.size() != n) {
    cout << -1;
    return 0;
  }
  for (int Q = 1; Q <= n; ++Q) {
    if (m[Q].size() != 4) {
      cout << -1;
      return 0;
    }
  }
  if (n == 5) {
    cout << 1 << " " << 2 << " " << 3 << " " << 4 << " " << 5;
    return 0;
  }
  set<int> used;
  used.insert(1);
  int cur = 1;
  vector<int> tmp(10000);
  vector<int> cands(10000);
  vector<int>::iterator r;
  set<int> prev;
  for (int Q = 1; Q <= n; ++Q) prev.insert(Q);
  int pp = cur;
  vector<int> ans;
  ans.push_back(cur);
  while (used.size() < n) {
    set<int> s = m[cur];
    int sz = 0;
    for (set<int>::iterator it = s.begin(); it != s.end(); ++it) {
      r = set_intersection(m[*it].begin(), m[*it].end(), s.begin(), s.end(),
                           tmp.begin());
      if (r - tmp.begin() == 2) cands[sz++] = *it;
    }
    for (int Q = 0; Q < sz; ++Q)
      if (used.find(cands[Q]) == used.end())
        if (prev.find(cands[Q]) != prev.end()) {
          cur = cands[Q];
          break;
        }
    if (cur == pp) {
      cout << -1;
      return 0;
    }
    ans.push_back(cur);
    used.insert(cur);
    prev = s;
    pp = cur;
  }
  for (int Q = 0; Q < ans.size(); ++Q) cout << ans[Q] << " ";
}
