#include <bits/stdc++.h>
using namespace std;
int n, p[100005], ady[100005][4], cnt = 1;
bool used[100005];
bool dfs(int nd, int t) {
  used[nd] = true;
  if (++cnt == n) {
    p[nd] = 1;
    bool ok = true;
    while ((t = p[t]) > 1 && ok) {
      ok = false;
      for (int j = 0; j < 4; ++j)
        if (t == ady[p[p[t]]][j]) ok = true;
    }
    --cnt;
    return true;
  }
  for (int i = 0; i < 4; ++i) {
    if (!used[ady[nd][i]]) {
      p[nd] = ady[nd][i];
      for (int j = 0; j < 4; ++j)
        if (ady[p[nd]][j] == t && dfs(p[nd], nd)) return true;
    }
  }
  --cnt;
  return (used[nd] = false);
}
int main() {
  int u, v, t;
  bool ok = true, val = false;
  scanf("%d", &n);
  t = n << 1;
  while (t--) {
    scanf("%d%d", &u, &v);
    ok &= (p[u] < 4 && p[v] < 4);
    if (ok) {
      ady[u][p[u]++] = v;
      ady[v][p[v]++] = u;
    }
  }
  if (ok) {
    ok = false;
    used[1] = true;
    for (int i = 0; i < 4 && !ok; ++i) {
      p[1] = ady[1][i];
      ok = dfs(ady[1][i], 1);
    }
  }
  if (ok) {
    t = 1;
    printf("1");
    while ((t = p[t]) > 1) printf(" %d", t);
  } else {
    printf("-1");
  }
  return 0;
}
