#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using u64 = uint64_t;
using pi64 = pair<i64, i64>;
constexpr i64 MAXN = 3 * 100 * 1000 + 5LL;
constexpr i64 MOD = 1000000007LL;
constexpr i64 INF64 = MOD * MOD;
bool is_possible(const vector<i64>& perm, const i64 N,
                 const vector<vector<i64>>& adj) {
  if (perm.size() < N) {
    return false;
  }
  for (i64 i = 0; i < N; ++i) {
    for (const i64 j : vector<i64>{(i - 2 + N) % N, (i - 1 + N) % N,
                                   (i + 1) % N, (i + 2) % N}) {
      if (find(adj[perm[i]].begin(), adj[perm[i]].end(), perm[j]) ==
          adj[perm[i]].end()) {
        ;
        return false;
      }
    }
  }
  return true;
}
pi64 find_nbrs(const i64 a, const vector<vector<i64>>& adj) {
  for (i64 j = 0; j < adj[a].size(); ++j) {
    const i64 b = adj[a][j];
    for (i64 k = j + 1; k < adj[a].size(); ++k) {
      const i64 c = adj[a][k];
      if (find(adj[b].begin(), adj[b].end(), c) == adj[b].end()) {
        continue;
      };
      return make_pair(b, c);
    }
  }
  return make_pair(-1, -1);
}
vector<i64> find_nbrs(const pi64 p, const vector<vector<i64>>& adj) {
  vector<i64> isect;
  for (const i64 x : adj[p.first]) {
    if (find(adj[p.second].begin(), adj[p.second].end(), x) !=
        adj[p.second].end()) {
      isect.push_back(x);
    }
  }
  return isect;
}
void try_find_erase(vector<i64>& haystack, const i64 needle) {
  if (const auto it = find(haystack.begin(), haystack.end(), needle);
      it != haystack.end()) {
    haystack.erase(it);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  const unsigned seed = chrono::system_clock::now().time_since_epoch().count();
  mt19937 gen(seed);
  i64 N;
  cin >> N;
  ;
  vector<vector<i64>> adj(N + 1);
  for (i64 i = 0; i < 2 * N; ++i) {
    i64 A;
    cin >> A;
    ;
    i64 B;
    cin >> B;
    ;
    adj[A].push_back(B);
    adj[B].push_back(A);
  }
  const vector<vector<i64>> adj_const(adj);
  vector<i64> ans;
  for (i64 i = 1; i <= N; ++i) {
    if (adj[i].size() != 4) {
      goto done;
    }
  }
  if (N >= 7) {
    const pi64 nbrs1(find_nbrs(1, adj));
    if (nbrs1.first < 0) {
      goto done;
    }
    vector<i64> nbrs1_intersect(find_nbrs(nbrs1, adj));
    if (nbrs1_intersect.size() == 1) {
      ;
      ans.push_back(nbrs1.first);
      ans.push_back(1);
      ans.push_back(nbrs1.second);
    } else if (nbrs1_intersect.size() == 2) {
      const vector<i64> fst(find_nbrs(make_pair(1, nbrs1.first), adj));
      const vector<i64> snd(find_nbrs(make_pair(1, nbrs1.second), adj));
      ans.push_back(1);
      if (fst.size() == 1) {
        ;
        ans.push_back(nbrs1.second);
        ans.push_back(nbrs1.first);
      } else if (snd.size() == 1) {
        ;
        ans.push_back(nbrs1.first);
        ans.push_back(nbrs1.second);
      } else {
        goto done;
      }
    } else {
      goto done;
    }
    set<i64> seen(ans.begin(), ans.end());
    for (; ans.size() < N;) {
      vector<i64> nbrs(
          find_nbrs(make_pair(*prev(prev(ans.end())), ans.back()), adj));
      for (auto it = nbrs.begin(); it != nbrs.end(); ++it) {
        if (seen.count(*it)) {
          nbrs.erase(it);
          break;
        }
      };
      if (nbrs.size() != 1) {
        ans.clear();
        goto done;
      }
      ans.push_back(nbrs.front());
      seen.insert(nbrs.front());
      try_find_erase(adj[ans[ans.size() - 1]], ans[ans.size() - 3]);
      try_find_erase(adj[ans[ans.size() - 3]], ans[ans.size() - 1]);
    }
  } else {
    vector<i64> perm;
    for (i64 i = 1; i <= N; ++i) {
      perm.push_back(i);
    }
    do {
      if (is_possible(perm, N, adj)) {
        break;
      }
    } while (next_permutation(perm.begin(), perm.end()));
    ans = perm;
  }
done:
  if (!is_possible(ans, N, adj_const)) {
    ans.clear();
    cout << "-1\n";
  }
  for (i64 i = 0; i < ans.size(); ++i) {
    cout << ans[i] << " \n"[i + 1 == N];
  }
  return 0;
}
