#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e9;
int n;
vector<int> c[100005];
int vis[100005];
int ans[100005];
int cot[100005];
bool _find(int x, int cc) {
  for (int i = 0; i < c[x].size(); i++)
    if (cc == c[x][i]) return 1;
  return 0;
}
bool dfs(int x, int indx) {
  if (indx == n) return true;
  vis[x] = 1;
  ans[indx] = x;
  bool ok = false;
  for (int i = 0; i < c[x].size(); i++) {
    int y = c[x][i];
    if (indx == n - 1) {
      if (_find(ans[0], x) && _find(ans[1], x) && _find(ans[0], ans[indx - 1]))
        ok = true;
    } else if (!vis[y] && (x == 1 || _find(y, ans[indx - 1])) && !ok) {
      ok = dfs(y, indx + 1);
    }
    if (ok) break;
  }
  vis[x] = 0;
  return ok;
}
int main() {
  int x, y;
  cin >> n;
  bool ok = true;
  for (int i = 0; i < 2 * n; i++) {
    scanf("%d %d", &x, &y);
    c[x].push_back(y);
    c[y].push_back(x);
    cot[x]++;
    cot[y]++;
    if (cot[x] > 4 || cot[y] > 4) ok = false;
  }
  if (ok) ok = dfs(1, 0);
  if (!ok)
    cout << -1 << endl;
  else {
    for (int i = 0; i < n; i++) printf("%d ", ans[i]);
    cout << endl;
  }
}
