#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200;
int n, i, j, l[MAXN], r[MAXN];
bool changed;
int main() {
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> l[i] >> r[i];
  }
  for (;;) {
    changed = 0;
    for (i = 1; i < n; ++i) {
      for (j = i + 1; j <= n; ++j) {
        if (l[i] == l[j]) {
          changed = 1;
          if (r[i] > r[j]) {
            ++l[i];
          } else {
            ++l[j];
          }
        }
      }
    }
    if (!changed) {
      break;
    }
  }
  for (i = 1; i <= n; ++i) {
    cout << l[i] << " ";
  }
  cout << endl;
  return 0;
}
