#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int n_ = 1e5 + 5;
int n, taken[n_];
vector<int> adj[n_], ans;
bool ok() {
  int a = 1, b = 2, f;
  for (int i = 3; i < n; i++, a++, b++) {
    f = 0;
    for (int x : adj[ans[a]]) {
      if (taken[x]) continue;
      if (binary_search(adj[ans[b]].begin(), adj[ans[b]].end(), x)) {
        f = 1;
        ans.push_back(x);
        taken[x] = 1;
        break;
      }
    }
    if (!f) return 0;
  }
  return binary_search(adj[1].begin(), adj[1].end(), ans.back()) &&
         binary_search(adj[ans[1]].begin(), adj[ans[1]].end(), ans.back());
}
int main() {
  scanf("%d", &n);
  int u, v;
  for (int i = 0; i < (n << 1); i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() != 4) {
      puts("-1");
      return 0;
    }
    sort(adj[i].begin(), adj[i].end());
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i == j) continue;
      if (binary_search(adj[adj[1][j]].begin(), adj[adj[1][j]].end(),
                        adj[1][i])) {
        ans.clear();
        memset(taken, 0, sizeof taken);
        ans.push_back(1);
        ans.push_back(adj[1][i]);
        ans.push_back(adj[1][j]);
        taken[1] = taken[ans[1]] = taken[ans[2]] = 1;
        if (ok()) {
          for (int x : ans) printf("%d ", x);
          return 0;
        }
      }
    }
  }
  puts("-1");
  return 0;
}
