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