#include <bits/stdc++.h>
using namespace std;
const int MPOW=16;
struct sg_tree
{
static const int n=1<<MPOW;
int arr[n];
sg_tree(){fill(arr,arr+n,0);}
void add(int x)
{
int cur=x+(1<<MPOW-1);
arr[cur]++;
while(cur>>=1)
arr[cur]=arr[cur<<1]+arr[(cur<<1)+1];
}
int SUM(int c,int cl,int cr,int l,int r)
{
if(l>r)
return 0;
if(l==cl && r==cr)
return arr[c];
int ct=(cl+cr)>>1;
return SUM(c<<1,cl,ct,l,min(r,ct))+SUM((c<<1)+1,ct+1,cr,max(l,ct+1),r);
}
int get_sum(int l,int r)
{return SUM(1,0,(1<<MPOW-1)-1,l,r);}
};
main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
sg_tree TR;
cin>>n;
int a,b;
vector<int> ans(n);
for(int i=0;i<n;i++)
{
cin>>a>>b;
TR.add(a);
ans[TR.get_sum(0,a)-1]++;
}
for(int i=0;i<n;i++)
cout<<ans[i]<<'\n';
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmNvbnN0IGludCBNUE9XPTE2OwpzdHJ1Y3Qgc2dfdHJlZQp7CnN0YXRpYyBjb25zdCBpbnQgbj0xPDxNUE9XOwppbnQgYXJyW25dOwpzZ190cmVlKCl7ZmlsbChhcnIsYXJyK24sMCk7fQoKdm9pZCBhZGQoaW50IHgpCnsKCWludCBjdXI9eCsoMTw8TVBPVy0xKTsKCWFycltjdXJdKys7Cgl3aGlsZShjdXI+Pj0xKQoJYXJyW2N1cl09YXJyW2N1cjw8MV0rYXJyWyhjdXI8PDEpKzFdOwp9CmludCBTVU0oaW50IGMsaW50IGNsLGludCBjcixpbnQgbCxpbnQgcikKewoJaWYobD5yKQoJcmV0dXJuIDA7CglpZihsPT1jbCAmJiByPT1jcikKCXJldHVybiBhcnJbY107CglpbnQgY3Q9KGNsK2NyKT4+MTsKCXJldHVybiBTVU0oYzw8MSxjbCxjdCxsLG1pbihyL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