#include <bits/stdc++.h>
using namespace std;
int mx[4005], S[4005];
int n, l[4005], r[4005], a[4005];
bool inter(int i, int j) {
  if (l[i] >= l[j] && l[i] <= r[j]) return 1;
  if (r[i] >= l[j] && r[i] <= r[j]) return 1;
  if (l[j] >= l[i] && l[j] <= r[i]) return 1;
  if (r[j] >= l[i] && r[j] <= r[i]) return 1;
  return 0;
}
bool check(int d) {
  int i, j, p, q;
  l[0] = -(1 << 30);
  for (i = 1; i <= n; i++) mx[i] = n;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) S[j] = 0;
    for (j = 1; j <= n; j++)
      if (mx[j] > 0) S[mx[j]]++;
    for (j = 1; j <= n; j++) S[j] = S[j] + S[j - 1];
    for (j = i; j <= n; j++)
      if (S[j] > j - i + 1) return 0;
    for (j = i; j <= n; j++)
      if (S[j] == j - i + 1) break;
    q = j, p = 0;
    for (j = 1; j <= n; j++)
      if (mx[j] > 0 && mx[j] <= q && l[j] > l[p]) p = j;
    mx[p] = -1, a[i] = p;
    for (j = 1; j <= n; j++)
      if (mx[j] > 0 && inter(p, j)) mx[j] = min(mx[j], i + d);
  }
  return 1;
}
int main() {
  int i, ll, rr, mid;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d %d", &l[i], &r[i]);
  ll = 0, rr = n - 1;
  while (rr - ll > 1) {
    mid = (ll + rr) >> 1;
    if (check(mid))
      rr = mid;
    else
      ll = mid;
  }
  check(rr);
  for (i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
