#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 100005;
int ans[maxn], link[maxn][5];
bool vis[maxn];
bool mark;
int n;
bool has(int arry[], int x) {
  for (int i = 1; i <= 4; i++) {
    if (arry[i] == x) return true;
  }
  return false;
}
void dfs(int id, int cnt) {
  if (cnt >= n) {
    mark = true;
    return;
  }
  if (mark) return;
  if (cnt <= 1) {
    for (int i = 1; i <= 4; i++) {
      if (mark) return;
      if (!vis[link[id][i]]) {
        vis[link[id][i]] = true;
        ans[cnt + 1] = link[id][i];
        dfs(link[id][i], cnt + 1);
        vis[link[id][i]] = false;
      }
    }
  } else {
    for (int i = 1; i <= 4; i++) {
      if (mark) return;
      if (!vis[link[id][i]] && has(link[ans[cnt - 1]], link[id][i])) {
        vis[link[id][i]] = true;
        ans[cnt + 1] = link[id][i];
        dfs(link[id][i], cnt + 1);
        vis[link[id][i]] = false;
      }
    }
  }
}
int main() {
  int a, b;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    link[i][0] = 0;
    vis[i] = false;
  }
  for (int i = 1; i <= n + n; i++) {
    scanf("%d %d", &a, &b);
    link[a][++link[a][0]] = b;
    link[b][++link[b][0]] = a;
  }
  for (int i = 1; i <= n; i++) {
    if (link[i][0] != 4) {
      printf("-1\n");
      return 0;
    }
  }
  mark = false;
  vis[1] = true;
  ans[1] = 1;
  dfs(1, 1);
  if (mark) {
    for (int i = 1; i < n; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[n]);
  } else
    printf("-1\n");
  return 0;
}
