#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, bool> edge;
map<pair<int, int>, bool>::iterator it;
vector<vector<int> > graph;
vector<int> ans;
int vis[100004];
int id = 1;
int main() {
  int n;
  int a, b;
  scanf("%d", &n);
  graph = vector<vector<int> >(n + 1);
  for (int i = 0; i < 2 * n; i++) {
    scanf("%d%d", &a, &b);
    edge[{a, b}] = 1;
    edge[{b, a}] = 1;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    if (graph[i].size() != 4) {
      puts("-1");
      return 0;
    }
  }
  sort(graph[1].begin(), graph[1].end());
  do {
    int a1 = graph[1][0], a2 = graph[1][1];
    ans.clear();
    ans.push_back(1);
    if (edge[{a1, a2}]) {
      ans.push_back(a1);
      ans.push_back(a2);
    }
    id++;
    vis[1] = vis[a1] = vis[a2] = id;
    for (int i = 4; i <= n; i++) {
      for (int j = 0; j < 4; j++) {
        int ch = graph[a2][j];
        if (edge[{a1, ch}] && vis[ch] != id) {
          ans.push_back(ch);
          swap(a1, a2);
          a2 = ch;
          vis[ch] = id;
          break;
        }
      }
    }
    if (ans.size() == n) {
      for (int i = 0; i < n; i++) {
        printf("%d ", ans[i]);
      }
      return 0;
    }
  } while (next_permutation(graph[1].begin(), graph[1].end()));
  puts("-1");
}
