We rank people's body size using two values: weight and height. If a person weighs x kg and is y cm tall, that person's body size is written as (x,y).
Given two people A and B with body sizes (x,y) and (p,q), we say A's body size is larger than B's if x>p and y>q. For example, if A and B have body sizes (56,177) and (45,165), then A is larger than B.
However, two body sizes are sometimes incomparable. For example, if C and D have body sizes (45,181) and (55,173), then D is heavier while C is taller, so by body size alone neither can be said to be larger than the other.
In a group of N people, a person's rank is the number of people whose body size is larger than theirs. If exactly k people are larger, that person's rank is k+1. Consequently, several people may share the same rank.
The table below shows the body sizes and ranks for a group of 5 people.
| Name | (weight, height) | Rank |
|---|---|---|
| A | (55, 185) | 2 |
| B | (58, 183) | 2 |
| C | (88, 186) | 1 |
| D | (60, 175) | 2 |
| E | (46, 155) | 5 |
No one is larger than C, so C is rank 1. Only C is larger than each of A, B, and D, so they are all rank 2. Four people (A, B, C, D) are larger than E, so E is rank 5. In this case ranks 3 and 4 do not appear.
Read the weight and height of N people and output each person's rank.
The first line contains the number of people N. Each of the next N lines contains two positive integers, the weight x and height y of one person, separated by a single space.
On the first line, print each person's rank in the order given by the input, separated by single spaces.