You should notice that when calculating the rank of someone's score, the rank is defined as the number of contestants who has the score larger than or equal to his score score.
Now, given a list of contestants, and their Rating before the contest and their Score in the contest, your task is to calculate the rating after a real rated codeforces round. After the round 327.
You should notice that, a regular codeforces round (Div. 1) may have atmost 800 contestants.
Every one on the list have made at least one submission. So that all of their ratings should be calculated.
The first line is an integer N, the number of contestants.
The following N lines, each line contains a string Namei and two integers Scorei and Ratingi.
Output containts N lines, the i-th line should be one integer: the new rating of the i-th contestant in the list after the contest.