#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, head[N], pre[N << 2], nxt[N << 2], e, deg[N], ans[N];
bool vis[N];
set<pair<int, int> > st;
void init() {
  memset(head, -1, sizeof(head));
  e = 0;
}
void add(int u, int v) { pre[e] = v, nxt[e] = head[u], head[u] = e++; }
bool judge() {
  int i, j, x[4], y[4];
  for (i = 1; i <= n; ++i)
    if (deg[i] != 4) return false;
  int u = 1, T = 0;
  while (1) {
    int m = 0;
    for (i = head[u]; ~i; i = nxt[i]) {
      x[m++] = pre[i];
    }
    memset(y, 0, sizeof(y));
    bool f = true;
    for (i = 0; i < 4; ++i) {
      for (j = i + 1; j < 4; ++j) {
        if (st.count(make_pair(min(x[i], x[j]), max(x[i], x[j])))) {
          ++y[i];
          ++y[j];
        }
      }
    }
    for (i = 0; i < 4; ++i)
      if (y[i] == 2) {
        if (!vis[x[i]]) {
          ans[T++] = u;
          vis[u] = 1;
          u = x[i];
          f = false;
          break;
        }
      }
    if (f) {
      ans[T++] = u;
      break;
    }
  }
  if (T != n) return false;
  return true;
}
bool dfs(int lef) {
  int i;
  if (lef == 0) {
    for (i = 1; i <= n; ++i) {
      int a = min(ans[i], ans[i % n + 1]);
      int b = max(ans[i], ans[i % n + 1]);
      if (st.count(make_pair(a, b)) == 0) return false;
      a = min(ans[i], ans[(i + 1) % n + 1]);
      b = max(ans[i], ans[(i + 1) % n + 1]);
      if (st.count(make_pair(a, b)) == 0) return false;
    }
    for (i = 1; i <= n; ++i) printf("%d ", ans[i]);
    puts("");
    return true;
  }
  for (i = 1; i <= n; ++i)
    if (!vis[i]) {
      vis[i] = 1;
      ans[lef] = i;
      if (dfs(lef - 1)) return true;
      vis[i] = 0;
    }
  return false;
}
int main() {
  cin >> n;
  init();
  int i, u, v;
  for (i = 0; i < n * 2; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
    ++deg[u], ++deg[v];
    st.insert(make_pair(min(u, v), max(u, v)));
  }
  if (n <= 6) {
    if (!dfs(n)) puts("-1");
    return 0;
  }
  if (judge()) {
    for (i = 0; i < n; ++i) printf("%d ", ans[i]);
    puts("");
  } else
    puts("-1");
  return 0;
}
