#include <bits/stdc++.h>
using namespace std;
static inline bool get(int &v) {
  int s = 1, c;
  while (!isdigit(c = getchar()) && c != '-') {
    if (c == EOF) break;
  }
  if (c == EOF) return 0;
  if (c == '-')
    s = 0, v = 0;
  else
    v = c ^ 48;
  for (; isdigit(c = getchar()); v = (v << 1) + (v << 3) + (c ^ 48))
    ;
  v = (s ? v : -v);
  return 1;
}
vector<int> link[100005];
int cnt[100005];
int vis[100005];
vector<int> ans;
int n;
int has(vector<int> e, int val) {
  for (int i = 0; i < e.size(); i++)
    if (e[i] == val) return 1;
  return false;
}
void dfs(int val) {
  int i;
  vis[val] = 1;
  ans.push_back(val);
  if (ans.size() == n) {
    for (i = 0; i < n; i++) printf("%d ", ans[i]);
    printf("\n");
    exit(0);
  }
  for (i = 0; i < link[val].size(); i++) {
    if (!vis[link[val][i]] && ans.size() <= 1) {
      dfs(link[val][i]);
      vis[link[val][i]] = 0;
      ans.pop_back();
    } else if (!vis[link[val][i]] && ans.size() >= 2) {
      if (has(link[ans[ans.size() - 2]], ans[ans.size() - 1]) &&
          has(link[ans[ans.size() - 2]], link[val][i]) &&
          has(link[ans[ans.size() - 1]], link[val][i])) {
        dfs(link[val][i]);
        vis[link[val][i]] = 0;
        ans.pop_back();
      }
    }
  }
}
int main() {
  int a, b, i;
  get(n);
  memset(cnt, 0, sizeof(cnt));
  memset(vis, 0, sizeof(vis));
  for (i = 0; i < 2 * n; i++) {
    get(a);
    get(b);
    cnt[a]++;
    cnt[b]++;
    link[a].push_back(b);
    link[b].push_back(a);
  }
  int ok = 1;
  for (i = 1; i <= n; i++) {
    if (cnt[i] != 4) {
      ok = 0;
      break;
    }
  }
  if (!ok)
    printf("-1\n");
  else {
    dfs(1);
    printf("-1\n");
  }
  return 0;
}
