#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cmath> #include <stack> #include <queue> #include <vector> #include <map> #include <string> #include <iostream> using namespace std; int a[222222]; int ret[222222]; const int Max=33000; int lowbit(int x) { return x&(-x); } int ask(int k) { int sum=0; while(k>0){ sum+=a[k]; k-=lowbit(k); } return sum; } void change(int x,int add) { while(x<=Max){ a[x]+=add; x+=lowbit(x); } } int main() { int n,x,y; while(scanf("%d",&n)!=EOF){ memset(a,0,sizeof(a)); memset(ret,0,sizeof(ret)); for(int i=0;i<n;i++){ scanf("%d%d",&x,&y); change(x+1,1); int ans=ask(x+1)-1; ret[ans]++; } for(int i=0;i<n;i++) printf("%d ",ret[i]); } return 0; }