K. GSS and Rating Calaulation
题号:NC15733
时间限制:C/C++/Rust/Pascal 4秒,其他语言8秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

The following text is simplily copied from MikeMirzayanov's blog.
http://codeforces.com/blog/entry/20762

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.
示例1

输入

复制
1
a 1 1500

输出

复制
1500