#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e5 + 10;
int n, u, v;
int ans[MaxN][5];
int cnt[MaxN];
int vis[MaxN];
int d[MaxN];
bool dfs(int a, int b, int k) {
  d[k - 1] = a, d[k] = b;
  if (k == n) return b == 1;
  vis[b] = 1;
  for (int i = 1; i <= 4; i++) {
    int c = ans[b][i];
    if (vis[c]) continue;
    if ((ans[a][1] == c || ans[a][2] == c || ans[a][3] == c ||
         ans[a][4] == c) &&
        dfs(b, c, k + 1))
      return true;
  }
  vis[b] = 0;
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * 2; i++) {
    scanf("%d%d", &u, &v);
    ans[u][++cnt[u]] = v;
    ans[v][++cnt[v]] = u;
    if (cnt[u] > 4 || cnt[v] > 4) {
      printf("-1\n");
      return 0;
    }
  }
  for (int i = 1; i <= 4; i++) {
    if (dfs(1, ans[1][i], 1)) {
      for (int j = 0; j < n; j++) printf("%d ", d[j]);
      printf("\n");
      return 0;
    }
    memset(d, 0, sizeof(d));
    memset(vis, 0, sizeof(vis));
  }
  printf("-1\n");
  return 0;
}
