#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100 * 1000 + 4, Inf = 1e9 + 10;
vector<int> adj[Maxn], ans;
int p[Maxn];
bool mark[Maxn];
int uu = 0;
bool Is(int i) {
  return (count(adj[uu].begin(), adj[uu].end(), i) && !mark[i]);
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
    if (max(adj[x].size(), adj[y].size()) > 4) {
      cout << -1 << endl;
      return 0;
    }
  }
  bool hora;
  for (int x = 0; x < 4; x++) {
    p[0] = adj[0][x];
    p[1] = 0;
    mark[p[0]] = mark[p[1]] = true;
    int u;
    for (int y = 0; y < 4; y++) {
      int kk = adj[0][y];
      for (int zer = 0; zer < Maxn; zer++) mark[zer] = 0;
      mark[p[0]] = mark[p[1]] = true;
      if (mark[kk]) continue;
      uu = 0;
      ans.clear();
      ans.push_back(p[0]);
      ans.push_back(p[1]);
      hora = true;
      p[2] = kk;
      ans.push_back(p[2]);
      u = kk;
      mark[kk] = true;
      for (int i = 3; i < n; i++) {
        p[i] = *find_if(adj[u].begin(), adj[u].end(), Is);
        if (adj[u].end() == find_if(adj[u].begin(), adj[u].end(), Is)) {
          hora = false;
          break;
        }
        mark[p[i]] = true;
        ans.push_back(p[i]);
        u = p[i];
        uu = p[i - 1];
      }
      if (hora) break;
    }
    if (hora) break;
  }
  if (hora)
    for (int i = 0; i < ans.size(); i++) cout << ans[i] + 1 << " ";
  else
    cout << -1 << endl;
  return 0;
}
