public class Dungchi {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int N = Integer.parseInt(br.readLine());
int[][] dungchi = new int[N][2];
int[] rank = new int[N];
for (int i = 0; i < N; i++) {
String[] s = br.readLine().split(" ");
dungchi[i][0] = Integer.parseInt(s[0]);
dungchi[i][1] = Integer.parseInt(s[1]);
}
for(int i = 0; i < N; i++) {
rank[i] = 1;
for(int j = 0; j < N; j++) {
if(i == j) continue;
if(dungchi[i][0] < dungchi[j][0] && dungchi[i][1] < dungchi[j][1]) {
rank[i] += 1;
}
}
}
for(int i = 0; i < N; i++) {
System.out.print(rank[i] + " ");
}
}
}
문제에 '키와 몸무게 둘 다 클 경우 덩치가 더 크고, 하나만 크거나 작을경우는 더 크다고 할 수 없다' 를 제대로 읽지 않고 풀다가 매우 해맸다.