#include <bits/stdc++.h>
using namespace std;
int vis[100100], res[100100];
vector<int> Q[100100];
int main() {
  int n, x, y, p, t;
  while (cin >> n) {
    for (int i = (int)0; i < (int)100100; i++) Q[i].clear(), vis[i] = 0;
    for (int i = (int)0; i < (int)2 * n; i++)
      cin >> x >> y, Q[x].push_back(y), Q[y].push_back(x);
    int yes = 1;
    for (int i = (int)1; i < (int)n + 1; i++)
      if (Q[i].size() != 4) yes = 0;
    if (yes) {
      for (int i = (int)0; i < (int)4; i++) res[i] = Q[1][i];
      res[4] = 1;
      sort(res, res + 5);
      do {
        memset(vis, 0, sizeof(vis));
        for (int i = (int)0; i < (int)5; i++) vis[res[i]] = 1;
        yes = 1;
        for (int i = (int)5; i < (int)n; i++) {
          if (!yes) break;
          set<int> ok, have;
          x = res[i - 1];
          for (int j = (int)0; j < (int)4; j++)
            if (!vis[Q[x][j]]) ok.insert(Q[x][j]);
          x = res[i - 2];
          for (int j = (int)0; j < (int)4; j++)
            if (!vis[Q[x][j]] && ok.count(Q[x][j])) have.insert(Q[x][j]);
          if (have.size() == 1)
            res[i] = *have.begin(), vis[res[i]] = 1;
          else
            yes = 0;
        }
        if (yes) {
          for (int i = (int)0; i < (int)n; i++) {
            if (!yes) break;
            p = res[i], x = res[(i + 1) % n], y = res[(i + 2) % n], t = 0;
            for (int j = (int)0; j < (int)4; j++) {
              if (Q[p][j] == x)
                t++;
              else if (Q[p][j] == y)
                t++;
            }
            if (t != 2) yes = 0;
          }
        }
        if (yes) break;
      } while (next_permutation(res, res + 5));
      if (yes) {
        for (int i = (int)0; i < (int)n; i++) cout << res[i] << " ";
        puts("");
      } else
        puts("-1");
    } else
      puts("-1");
  }
  return 0;
}
