#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 5;
const long long maxm = 500000 + 5;
const long long mod = 1000000007;
vector<int> e[200010], ans;
map<int, bool> vis[200010];
bool mark[200010];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
    vis[x][y] = true;
    vis[y][x] = true;
  }
  for (int i = 1; i <= n; i++)
    if (e[i].size() != 4) {
      printf("-1\n");
      return 0;
    }
  int x = 1, y = 1;
  for (int i = 0; i < n; i++) {
    bool flag = false;
    mark[x] = true;
    ans.push_back(x);
    for (int j = 0; j < 4; j++) {
      int num = 0;
      int cur = e[x][j];
      for (int k = 0; k < 4; k++)
        if (vis[x][e[cur][k]]) num++;
      if (num > 1 && !mark[cur] && vis[y][cur]) {
        y = x;
        x = cur;
        flag = true;
        break;
      }
    }
    if (!flag && i + 1 != n) {
      printf("-1\n");
      return 0;
    }
  }
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
