#include <bits/stdc++.h>
using namespace std;
vector<set<int> > g;
vector<int> ans;
vector<bool> used;
void dfs(int v, int p) {
  used[v] = true;
  ans.push_back(v);
  for (set<int>::iterator i = g[v].begin(); i != g[v].end(); i++) {
    if (!used[*i] && g[*i].count(p)) dfs(*i, v);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  g.resize(n);
  used.resize(n, false);
  for (int i = 0; i < 2 * n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    g[a].insert(b);
    g[b].insert(a);
    if (g[a].size() > 4 || g[b].size() > 4) {
      puts("-1");
      return 0;
    }
  }
  ans.push_back(0);
  used[0] = true;
  int st, p = -1;
  for (set<int>::iterator i = g[0].begin(); i != g[0].end(); i++) {
    int temp = 0, mp;
    for (set<int>::iterator j = g[0].begin(); j != g[0].end(); j++) {
      if (g[*i].count(*j)) {
        temp++;
        mp = *j;
      }
    }
    if (temp == 1 && n > 6 || temp && n < 7) {
      st = *i;
      p = mp;
      break;
    }
  }
  if (p == -1) {
    puts("-1");
    return 0;
  }
  ans.push_back(p);
  used[p] = true;
  dfs(st, p);
  if (ans.size() != n) {
    puts("-1");
    return 0;
  }
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i] + 1);
  }
  return 0;
}
