#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int head[MAXN], app[MAXN], ans[MAXN];
;
int n, a, b, num, tot;
bool ok, vis[MAXN];
void print() {
  if (ok) return;
  cout << "-1" << endl;
  exit(0);
}
struct Edge {
  int to, from;
  int nxt;
} edge[4 * MAXN];
void add_edge(int from, int to) {
  tot++;
  edge[tot].from = from;
  edge[tot].to = to;
  edge[tot].nxt = head[from];
  head[from] = tot;
};
bool dfs(int u, int fa, int d) {
  if (d == n) return true;
  if (!vis[u]) {
    vis[u] = true;
    ans[d] = u;
    if (fa == -1) {
      for (int i = head[u]; i != -1; i = edge[i].nxt) {
        int v = edge[i].to;
        if (dfs(v, u, d + 1)) return true;
      }
    } else {
      for (int i = head[u]; i != -1; i = edge[i].nxt) {
        int v = edge[i].to;
        if (v == fa) continue;
        bool flag1 = false, flag2 = false;
        for (int j = head[v]; j != -1; j = edge[j].nxt) {
          if (edge[j].to == u) flag1 = true;
          if (edge[j].to == fa) flag2 = true;
        }
        if (flag1 && flag2) {
          if (dfs(v, u, d + 1)) return true;
        }
      }
    }
    vis[u] = false;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  tot = 0;
  memset(head, -1, sizeof(head));
  ok = true;
  for (int i = 0; i < 2 * n; i++) {
    cin >> a >> b;
    add_edge(a, b);
    add_edge(b, a);
    app[a]++;
    app[b]++;
  }
  for (int i = 1; i <= n; i++) {
    if (app[i] != 4) {
      ok = false;
      break;
    }
  }
  print();
  ok = false;
  memset(vis, 0, sizeof(vis));
  ok = dfs(1, -1, 0);
  if (ok) {
    for (int i = 0; i < n; i++) {
      if (i) cout << " ";
      cout << ans[i];
    }
    cout << endl;
  } else {
    cout << "-1" << endl;
  }
  return 0;
}
