Each student has two subject scores. A student strictly dominates another if both scores are higher. Each student's rank is one plus the number of students who strictly dominate them. Print all ranks in input order, space-separated on one line.
Input
Line 1: $N$ ($2 \le N \le 200$). Next $N$ lines: two scores $A$, $B$ ($0 \le A, B \le 100$).
Output
Print the $N$ ranks in input order.
Example 1
Input
5 80 90 90 80 85 95 70 70 100 100
Output
3 2 2 5 1
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.