#include <bits/stdc++.h>
using namespace std;
const int MAXN=32001;
struct fenwick
{
int T[MAXN];
fenwick()
{for(int i=0;i<MAXN;i++)
T[i]=0;}
void edit(int at,int to)
{while(at<MAXN)
T[at]+=to,at|=at+1;}
int sum(int x)
{int res=0;
while(x>=0)
res+=T[x],x=(x&(x+1))-1;
return res;}
int get_sum(int l,int r)
{return sum(r)-sum(l-1);}
};
main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
fenwick x;
vector<int> ans(n);
for(int i=0;i<n;i++)
{
int a,b;
cin>>a>>b;
ans[x.get_sum(0,a)]++;
x.edit(a,1);
}
for(int i=0;i<n;i++)
cout<<ans[i]<<'\n';
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgaW50IE1BWE49MzIwMDE7CnN0cnVjdCBmZW53aWNrCnsKaW50IFRbTUFYTl07CmZlbndpY2soKQp7Zm9yKGludCBpPTA7aTxNQVhOO2krKykKVFtpXT0wO30KCnZvaWQgZWRpdChpbnQgYXQsaW50IHRvKQp7d2hpbGUoYXQ8TUFYTikKVFthdF0rPXRvLGF0fD1hdCsxO30KCmludCBzdW0oaW50IHgpCntpbnQgcmVzPTA7CndoaWxlKHg+PTApCnJlcys9VFt4XSx4PSh4Jih4KzEpKS0xOwpyZXR1cm4gcmVzO30KCmludCBnZXRfc3VtKGludCBsLGludCByKQp7cmV0dXJuIHN1bShyKS1zdW0obC0xKTt9Cgp9OwoKbWFpbigpCiB7CiAgICBpb3M6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbi50aWUoMCk7CglpbnQgbjsKCWNpbj4+bjsKCWZlbndpY2sgeDsKCXZlY3RvcjxpbnQ+IGFucyhuKTsKCWZvcihpbnQgaT0wO2k8bjtpKyspCgl7CgkJaW50IGEsYjsKCQljaW4+PmE+PmI7CgkJYW5zW3guZ2V0X3N1bSgwLGEpXSsrOwoJCXguZWRpdChhLDEpOwoJfQoJZm9yKGludCBpPTA7aTxuO2krKykKICAgICAgICBjb3V0PDxhbnNbaV08PCdcbic7Cn0=