#include <bits/stdc++.h>
using namespace std;
int n;
int ans[100100];
vector<int> g[100100];
int vis[100100];
bool judge1(int cur, int val) {
  if (cur <= 2) return true;
  int i, j;
  int pre = cur - 2;
  int k = ans[pre];
  for (i = 0; i < 4; i++) {
    if (g[k][i] == val) {
      return true;
    }
  }
  return false;
}
bool judge2() {
  int i, j;
  int x = ans[2];
  int y = ans[n];
  for (i = 0; i < 4; i++) {
    if (g[x][i] == y) {
      break;
    }
  }
  if (i == 5) {
    return false;
  }
  x = ans[1], y = ans[n - 1];
  for (i = 0; i < 4; i++) {
    if (g[x][i] == y) {
      return true;
    }
  }
  return false;
}
bool dfs(int cur, int val) {
  int i, j;
  if (cur == n) {
    if (judge2()) {
      return true;
    }
    return false;
  }
  for (i = 0; i < 4; i++) {
    int y = g[val][i];
    if (!vis[y] && judge1(cur + 1, y)) {
      vis[y] = 1;
      ans[cur + 1] = y;
      if (dfs(cur + 1, y)) {
        return true;
      }
      vis[y] = 0;
    }
  }
  return false;
}
int main() {
  int i, j;
  cin >> n;
  for (i = 0; i < 2 * n; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (i = 1; i <= n; i++) {
    if (g[i].size() != 4) {
      puts("-1");
      return 0;
    }
  }
  memset(vis, 0, sizeof(vis));
  ans[1] = 1;
  vis[1] = 1;
  if (dfs(1, 1)) {
    for (i = 1; i <= n; i++) {
      cout << ans[i];
      if (i == n) {
        cout << endl;
      } else {
        cout << " ";
      }
    }
  } else {
    puts("-1");
  }
  return 0;
}
