|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초 (추가 시간 없음)||1024 MB||55||37||23||79.310%|
The Olympic Games are the most important sporting events in human history. Usually, the Olympic Games are held every four years. However, the 2020 Olympic Games just finished in August 2021 due to the COVID-19 outbreaks.
There are more than 200 nations participating in the Olympic Games. Thousands of athletes around the world compete in various sports. The athletes represent their countries or National Olympic Committees (NOCs) to compete for medals. Therefore, each country or NOC may win medals in the competitions.
There are three types of medals: gold medals, silver medals, and bronze medals. Typically, the gold medals are awarded to the winners of the competitions, and silver medals are awarded to the runner-ups. Most of the bronze medals are awarded to the second runner-ups. However, there can be no second runner-up in some sports. The bronze medals can be awarded in different manners. For example, in a few tournament sports, such as wrestling, boxing, and judo, two bronze medals are awarded to the eliminated semi-finalists.
A country or NOC has a better rank than another country or NOC if one of the following conditions holds.
Please write a program to find the country or NOC which has the best rank among all countries and NOCs.
The first line of the input contains one positive integer n. Then n lines follow. Each of the following lines contains three non-negative integers g, s, b, and the name of a country or NOC. They are separated by blanks.
Print the name of the country or NOC of the best rank.
4 22 21 22 Great Britain 27 14 17 Japan 39 41 33 United States of America 20 28 23 ROC
United States of America
3 999 999 998 Malaysia 999 999 999 Thailand 999 998 999 Indonesia