#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, l, r, n, j, c = 0;
  cin >> t;
  for (i = 1; i <= t; i++) {
    cin >> n;
    for (j = 1; j <= n; j++) {
      cin >> l;
      cin >> r;
      if (l <= j && r >= j) {
        c++;
        cout << c << " ";
      } else
        cout << 0 << " ";
    }
    c = 0;
  }
}
