#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct INFO
{
unsigned int _weight;
unsigned int _height;
};
int main()
{
int count = 0;
int level = 1;
std::vector<INFO> vecInfo = {};
std::cin >> count;
for (int i = 0; i < count; ++i)
{
INFO info = {};
std::cin >> info._weight >> info._height;
vecInfo.emplace_back(info);
}
for (int i = 0; i < vecInfo.size(); ++i)
{
for (int j = 0; j < vecInfo.size(); ++j)
{
if (i == j)
continue;
if (vecInfo[i]._height < vecInfo[j]._height && vecInfo[i]._weight < vecInfo[j]._weight)
++level;
}
std::cout << level << ' ';
level = 1;
}
return 0;
}
pair라는 것을 알았다면은 구조체를 사용안해도 되었을 거 같다.