#include <iostream>
#include <vector>
using namespace std;
int main(void)
{
ios::sync_with_stdio;
cin.tie(NULL);
cout.tie(NULL);
int input;
cin >> input;
int x, y;
vector<pair<int,pair<int,int>>> hu;
for (int i = 0; i < input; ++i)
{
cin >> x >> y;
hu.push_back(make_pair(x, make_pair(y,1)));
}
for (int i = 0; i < input; ++i)
{
for (int j = 0; j < input; ++j)
{
if (hu[i].second.first < hu[j].second.first &&
hu[i].first < hu[j].first)
{
hu[i].second.second++;
}
}
}
for (int i = 0; i < input; ++i)
{
cout << hu[i].second.second << ' ';
}
return 0;
}