#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int n;
int a[maxn];
int g[maxn][5];
bool b[maxn];
int x, y;
int i;
int dep;
void print() {
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  exit(0);
}
bool ok(int u, int x) {
  if (!u) return true;
  if (a[u] == g[x][1] || a[u] == g[x][2] || a[u] == g[x][3] || a[u] == g[x][4])
    return true;
  return false;
}
void dfs() {
  if (dep == n) print();
  for (int i = 1; i <= 4; i++)
    if (!b[g[a[dep]][i]]) {
      if (ok(dep - 1, g[a[dep]][i])) {
        a[dep + 1] = g[a[dep]][i];
        b[a[dep + 1]] = true;
        dep++;
        dfs();
        dep--;
        b[a[dep + 1]] = false;
      }
    }
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n << 1; i++) {
    scanf("%d%d", &x, &y);
    g[x][++g[x][0]] = y;
    g[y][++g[y][0]] = x;
  }
  a[1] = 1;
  memset(b, false, sizeof(b));
  b[1] = true;
  dep = 1;
  dfs();
  printf("%d", -1);
  return 0;
}
