#include <bits/stdc++.h>
using namespace std;
vector<int> a[100005];
int ans[100005] = {0}, n, used[100005] = {0};
bool con(int x, int y) {
  for (int i = 0; i < 4; i++)
    if (a[x][i] == y) return 1;
  return 0;
}
bool dfs(int p) {
  if (p == n) {
    if (con(ans[n - 1], ans[1]) && con(ans[n], ans[1]) && con(ans[n], ans[2])) {
      for (int i = 1; i <= n; i++) cout << ans[i] << " ";
      exit(0);
    } else
      return 0;
  }
  for (int i = 0; i < 4; i++) {
    int next = a[ans[p]][i];
    ans[p + 1] = next;
    if (!used[next] && (p > 1 ? con(next, ans[p - 1]) : 1)) {
      used[next] = 1;
      dfs(p + 1);
      used[next] = 0;
    }
  }
}
int main() {
  cin >> n;
  int x, y;
  for (int i = 0; i < 2 * n; i++) {
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i].size() != 4) {
      cout << "-1";
      return 0;
    }
  }
  used[1] = 1;
  ans[1] = 1;
  dfs(1);
  cout << -1;
  return 0;
}
