#include <bits/stdc++.h>
using namespace std;
int n, a[100005][5], b[100005], c[100005];
bool visit[100005];
bool dfs(int t, int x, int y) {
  int i, k;
  b[t - 1] = x;
  b[t] = y;
  if (t == n) {
    if (y == 1)
      return true;
    else
      return false;
  }
  visit[y] = true;
  for (i = 0; i < 4; i++) {
    k = a[y][i];
    if (visit[k] == true) continue;
    if ((a[x][0] == k || a[x][1] == k || a[x][2] == k || a[x][3] == k) &&
        dfs(t + 1, y, k) == true)
      return true;
  }
  visit[y] = false;
  return false;
}
int main() {
  int i, j, x, y;
  scanf("%d", &n);
  memset(c, 0, sizeof(c));
  for (i = 0; i < 2 * n; i++) {
    scanf("%d%d", &x, &y);
    a[x][c[x]++] = y;
    a[y][c[y]++] = x;
    if (c[x] > 4 || c[y] > 4) {
      printf("-1\n");
      return 0;
    }
  }
  for (i = 0; i < 4; i++) {
    if (dfs(1, 1, a[1][i]) == true) {
      for (j = 0; j < n; j++) printf("%d ", b[j]);
      printf("\n");
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
