#include <bits/stdc++.h>
using namespace std;
vector<int> L[100005], AD[100005], node;
bool vis2[100005];
int n;
void DFS2(int nodo) {
  if (vis2[nodo]) return;
  vis2[nodo] = 1;
  node.push_back(nodo);
  for (int i = 0; i < AD[nodo].size(); i++) DFS2(AD[nodo][i]);
}
map<pair<int, int>, int> edge;
bool correct1(vector<int>& v) {
  if (edge.find(make_pair(v[0], v[3])) != edge.end()) return 0;
  if (edge.find(make_pair(v[1], v[3])) != edge.end()) return 0;
  if (edge.find(make_pair(v[0], v[2])) != edge.end()) return 0;
  return 1;
}
bool correct2(vector<int>& v) {
  for (int i = 0; i < v.size(); i++) {
    if (edge.find(make_pair(v[i], v[(i + 1) % n])) == edge.end()) return 0;
    if (edge.find(make_pair(v[i], v[(i + 2) % n])) == edge.end()) return 0;
    if (edge.find(make_pair(v[i], v[(i - 1 + n) % n])) == edge.end()) return 0;
    if (edge.find(make_pair(v[i], v[(i - 2 + n) % n])) == edge.end()) return 0;
  }
  return 1;
}
int main() {
  int k;
  while (scanf("%d", &n) == 1) {
    int x, y;
    for (int i = 0; i < 2 * n; i++) {
      cin >> x >> y;
      x--;
      y--, L[x].push_back(y);
      L[y].push_back(x);
      edge[make_pair(x, y)] = edge[make_pair(y, x)] = 1;
    }
    for (int i = 0; i < n; i++) sort((L[i]).begin(), (L[i]).end());
    bool yes = 1;
    for (int i = 0; i < n; i++)
      if (L[i].size() != 4) yes = 0;
    if (!yes)
      puts("-1");
    else {
      if (n <= 6) {
        vector<int> v;
        bool ok = 0;
        for (int i = 0; i < n; i++) v.push_back(i);
        do {
          if (correct2(v)) {
            ok = 1;
            break;
          }
        } while (next_permutation((v).begin(), (v).end()));
        if (!ok)
          puts("-1");
        else {
          for (int i = 0; i < n; i++) {
            if (i == 0)
              cout << v[i] + 1;
            else
              cout << " " << v[i] + 1;
          }
          puts("");
        }
      } else {
        bool ok = 1;
        for (int i = 0; i < n; i++) {
          vector<int>& v = L[i];
          bool entro = 0;
          do {
            if (n > 6 && correct1(v)) {
              AD[i].push_back(v[1]);
              AD[i].push_back(v[2]);
              entro = 1;
              break;
            }
          } while (next_permutation((v).begin(), (v).end()));
          if (!entro) {
            ok = 0;
            break;
          }
        }
        if (!ok)
          puts("-1");
        else {
          DFS2(0);
          if (node.size() != n)
            puts("-1");
          else {
            for (int i = 0; i < node.size(); i++) {
              if (i == 0)
                cout << node[i] + 1;
              else
                cout << " " << node[i] + 1;
            }
          }
        }
      }
    }
  }
}
