#include <bits/stdc++.h>
using namespace std;
int n, node[100005][5], ans[100005];
bool vis[100005];
bool ok(int k, int v) {
  if (!k) return true;
  for (int i = 1; i <= 4; i++)
    if (node[k][i] == v) return true;
  return false;
}
bool dfs(int u, int num) {
  if (num == n) return true;
  for (int i = 1; i <= 4; i++) {
    int v = node[u][i];
    if (!vis[v] && ok(ans[num - 1], v)) {
      vis[v] = true;
      ans[num + 1] = v;
      if (dfs(v, num + 1)) return true;
      vis[v] = false;
    }
  }
  return false;
}
int main() {
  bool flag = true;
  int x, y;
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n; i++) {
    scanf("%d %d", &x, &y);
    if (flag) {
      if (node[x][0] == 4 || node[y][0] == 4)
        flag = false;
      else {
        node[x][++node[x][0]] = y;
        node[y][++node[y][0]] = x;
      }
    }
  }
  if (flag) {
    memset(vis, false, sizeof(vis));
    vis[1] = true;
    ans[1] = 1;
    if (dfs(1, 1))
      for (int j = 1; j <= n; j++) printf("%d ", ans[j]);
    else
      printf("-1\n");
  } else
    printf("-1\n");
  return 0;
}
