#include<scoring>

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

As you may know, LTH Challenge is part of a series of seven competitions called the Swedish Coding Cup. Each contest in the series gives the contestants a number of points depending on how well they place in the contest.

After each contest, scores are assigned according to the following table:

RankScoreRankScore
1110010016161515
22757517171414
33606018181313
44505019191212
55454520201111
66404021211010
773636222299
883232232388
992929242477
10102626252566
11112424262655
12122222272744
13132020282833
14141818292922
15151616303011

If a contestant get a worse rank than 3030, they get 00 points.

If two or more contestants get the same rank in the contest, they are instead assigned the average score of all the corresponding ranks. This score is always rounded up to the closest integer. For example, if three contestants share the second place they all recieve 75+60+503=62\lceil \frac{75 + 60 + 50}{3} \rceil = 62 points.

Contestants may participate in every contest either on-site or online. If they compete on-site, they get one extra point, no matter their original score. If a contestant does not participate in a contest, they are assigned a score of 00.

At LTH Challenge, the rank of each contestant is computed using what is called ACM scoring. Each contestant is ranked first on the number of problems they solve (in descending order), secondly on their time penalty (in ascending order) and finally the time at which they submitted their last accepted solution in minutes (in ascending order). If all these three properties are equal, the contestants are tied.

As you may understand, it is really tedious to compute the scores of all the contestants after such a contest. The jury does not really want to program this themselves; they prefer to just use some existing library instead. However, it turns out that since this is the first time the Swedish Coding Cup is held, nobody had written such a library!

Fortunately, they have you.

입력

The input consists of:

  • one line with the integer nn (1n1,0001 \le n \le 1\\,000), the number of contestants.
  • nn lines with the integers ss, pp, ff and oo, (0s90 \le s \le 9, 0p1090 \le p \le 10^9, 0f3000 \le f \le 300, 0o10 \le o \le 1) -- the number of problems solved by a contestant, the time penalty of the contestant, the time at which they submitted their last accepted solution and the number of extra points the contestant should get due to competing on-site.

출력

Output nn lines containing the scores of all the contestants in the order they were listed in the input.