#include <bits/stdc++.h>
using namespace std;
int n, g[100100][5], d[100100], v[100100];
bool in[100100];
bool dfs(int a, int b, int k = 1) {
  v[k - 1] = a, v[k] = b;
  if (k < n) {
    in[b] = 1;
    for (int i = 0; i < 4; ++i) {
      int c = g[b][i];
      if (in[c]) continue;
      if ((g[a][0] == c || g[a][1] == c || g[a][2] == c || g[a][3] == c) &&
          dfs(b, c, k + 1))
        return 1;
    }
    in[b] = 0;
    return 0;
  } else
    return 1 == b;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, a, b; i <= 2 * n; ++i) {
    scanf("%d%d", &a, &b);
    g[a][d[a]++] = b, g[b][d[b]++] = a;
    if (d[a] > 4 || d[b] > 4) return 0 * puts("-1");
  }
  for (int i = 0; i < 4; ++i) {
    if (dfs(1, g[1][i])) {
      for (int j = 0; j < n; ++j) printf("%d ", v[j]);
      return 0;
    }
  }
  return 0 * puts("-1");
}
