#include <bits/stdc++.h>
using namespace std;
long long n, u, v, i, vis[100005];
vector<long long> ans;
set<long long> edges[100005];
bool check(int u, int v, int p) {
  if (p > 0 && !edges[p].count(v)) return 0;
  long long cnt = 0;
  for (int x : edges[v]) cnt += edges[u].count(x);
  return (cnt >= 2);
}
void solve(int u = 1, int p = 0) {
  if (vis[u]++) return;
  ans.push_back(u);
  for (int v : edges[u])
    if (!vis[v] && check(u, v, p)) return solve(v, u);
}
int main() {
  cin.tie(0);
  std ::ios ::sync_with_stdio(false);
  ;
  cin >> n;
  for (i = 0; i < 2 * n; ++i) {
    cin >> u >> v;
    edges[u].insert(v);
    edges[v].insert(u);
  }
  solve();
  if (ans.size() != n) return printf("-1\n"), 0;
  for (int x : ans) printf("%d ", x);
  printf("\n");
  return 0;
}
