/*
Subject: 树状数组
Author : a_clay
Created Date : 2012-02-02
Sample : poj 2352 Stars
*/
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <queue>
#include <algorithm>
#define Bug cout << "here\n";
using namespace std;
const int N = 15005;
const int M = 32005;
int B[M];
int cnt[N];
int n, T, k;
int lowbit(int x) {
return x & (-x);
}
void add(int i, int x) {
while(i <= M) { // 注意, 不是 n, 是 M
B[i] += x;
i = i + lowbit(i);
}
} //得到 Bn
long long getsum(int i) {
long long sum = 0;
while(i > 0) {
sum += B[i];
i = i - lowbit(i);
}
return sum;
}
int main() {
int x, y, i;
memset(cnt, 0, sizeof(cnt));
memset(B, 0, sizeof(B));
scanf("%d", &n);
for(i = 0; i < n; i++) {
scanf("%d%d", &x, &y);
cnt[getsum(++x)]++;
add(x, 1);
}
for(i = 0; i < n; i++) {
cout << cnt[i] << endl;
}
system("pause");
return 0;
}