#include <bits/stdc++.h>
int ao[100000][4];
int connected(int u, int v) {
  int h;
  for (h = 0; h < 4; h++)
    if (ao[u][h] == v) return 1;
  return 0;
}
int qq[100000];
int solve(int n, int u, int v, int w) {
  int h, i, x;
  qq[0] = u, qq[1] = v, qq[2] = w;
  for (i = 3; i < n; i++) {
    for (h = 0; h < 4; h++) {
      x = ao[w][h];
      if (x != u && x != v && connected(v, x)) break;
    }
    if (h == 4) return 0;
    qq[i] = x;
    u = v, v = w, w = x;
  }
  u = qq[0], v = qq[1], w = qq[n - 2], x = qq[n - 1];
  return connected(u, x) && connected(v, x) && connected(u, w);
}
int main() {
  static int kk[100000];
  int n, h, hu, hv, i, j, u, v;
  scanf("%d", &n);
  for (h = 0; h < n * 2; h++) {
    scanf("%d%d", &i, &j), i--, j--;
    if (kk[i] == 4 || kk[j] == 4) {
      printf("-1\n");
      return 0;
    }
    ao[i][kk[i]++] = j;
    ao[j][kk[j]++] = i;
  }
  for (hu = 0; hu < 4; hu++) {
    u = ao[0][hu];
    for (hv = hu + 1; hv < 4; hv++) {
      v = ao[0][hv];
      if (connected(u, v) && solve(n, u, 0, v)) {
        for (i = 0; i < n; i++) printf("%d ", qq[i] + 1);
        printf("\n");
        return 0;
      }
    }
  }
  printf("-1\n");
  return 0;
}
