#include <bits/stdc++.h>
using namespace std;
int n, i, j, x, y, ev, l, p, u, sel[100005], q[100005];
vector<int> G[100005];
int DF() {
  while (p <= u) {
    int x = q[p], y = q[p - 1];
    for (int i = 0; i < 4; ++i) {
      int aux = G[x][i];
      int ev = 0;
      for (int j = 0; j < 4; ++j)
        if (G[aux][j] == x || G[aux][j] == y) ev++;
      if (ev == 2 && !sel[aux]) {
        q[++u] = aux;
        sel[aux] = 1;
      }
    }
    p++;
  }
  if (n == u) return 1;
  return 0;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= 2 * n; ++i) {
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
    G[y].push_back(x);
  }
  for (i = 1; i <= n; ++i)
    if (G[i].size() != 4) {
      printf("-1");
      return 0;
    }
  for (i = 0; i < 4; ++i)
    for (j = i + 1; j < 4; ++j) {
      x = G[1][i];
      y = G[1][j];
      ev = 0;
      for (l = 0; l < 4; ++l)
        if (G[x][l] == y) ev = 1;
      if (ev) {
        memset(sel, 0, sizeof(sel));
        p = u = 3;
        q[1] = 1;
        q[2] = x;
        q[3] = y;
        sel[1] = sel[x] = sel[y] = 1;
        if (DF()) {
          for (l = 1; l <= n; ++l) printf("%d ", q[l]);
          return 0;
        }
        memset(sel, 0, sizeof(sel));
        p = u = 3;
        q[1] = 1;
        q[2] = y;
        q[3] = x;
        sel[1] = sel[x] = sel[y] = 1;
        if (DF()) {
          for (l = 1; l <= n; ++l) printf("%d ", q[l]);
          return 0;
        }
      }
    }
  printf("-1");
  return 0;
}
