#include<cstdio>
#include<iostream>
using namespace std;
int main(){
freopen("sunbofu.in","r",stdin);
freopen("sunbofu.out","w",stdout);
int n;
int i;
int b[100002]={};
int a[100002]={};
int xs[100002]={};//下属
cin>>n;
for(i=0;i<n;i++){
cin>>a[i]>>b[i];
}
int j;
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(i==j)
continue;
if(a[i]>=a[j]&&b[i]>=b[j]&&
!(a[i]==a[j]&&b[i]==b[j]&&i>j)){
xs[i]++;
}
}
cout<<xs[i]<<endl;
}
return 0;
}