#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[100010];
vector<int> ans;
bool d = 0;
bool v[100010];
void solve(int node, int par) {
  if ((ans.size()) == n) {
    if (count(adj[par].begin(), adj[par].end(), 1)) d = 1;
    return;
  }
  for (int i = 0; i < 4; ++i) {
    int child = adj[node][i];
    if (child != par && !v[child] &&
        count(adj[par].begin(), adj[par].end(), child)) {
      ans.push_back(child);
      v[child] = 1;
      solve(child, node);
      if (d)
        return;
      else
        ans.pop_back(), v[child] = 0;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; ++i) {
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
    if ((adj[u].size()) > 4 || (adj[v].size()) > 4) return puts("-1");
  }
  for (int i = 1; i <= n; ++i)
    if ((adj[i].size()) != 4) return puts("-1");
  ans.push_back(1);
  v[1] = 1;
  for (int i = 0; i < 4; ++i) {
    ans.push_back(adj[1][i]);
    v[adj[1][i]] = 1;
    solve(adj[1][i], 1);
    if (d)
      break;
    else
      ans.pop_back(), v[adj[1][i]] = 0;
  }
  if (d)
    for (int i = 0; i < n; ++i) printf("%d ", ans[i]);
  else
    printf("-1");
  return 0;
}
