#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; const int N=32005; int a[N]; int tr[N]; int level[N]; int n,m; int lowbit(int x) { return x& -x; } void add(int x,int c) { for(int i=x;i<=N;i+=lowbit(i)) tr[i]+=c; } int sum(int x) { int res=0; for(int i=x;i;i-=lowbit(i)) res+=tr[i]; return res; } int main() { int x,y ; while(cin>>n) { memset(tr,0,sizeof tr); memset(a,0,sizeof a); memset(level,0,sizeof level); for(int i=0;i<n;++i) { int x, y; scanf("%d %d",&x,&y); ++ x; level[sum(x)] ++; add(x,1); } for(int i = 0;i<n;++ i) printf("%d ",level[i]); } return 0 ; }