The ECOO programming contest is coming up soon and it's about time to determine which teams will represent Mackenzie at ECOO. Siavash is curious if his team will be one of these teams. Help him determine the teams that will go to ECOO. Each school is able to send 2 general teams and 1 girls team. Any team type can qualify as a general team, but only girls teams can compete as a girls team. We will send the best teams possible from our school. To determine the best teams, we host the JDCC competitions. The higher a team's JDCC score, the better they are considered as a team at programming. Given all the team names, their scores on the JDCC and their team type (
girls), output the name(s) of the team(s) representing Mackenzie at ECOO, in alphabetical order. If zero teams will represent Mackenzie, output
No ECOO :(.
Input will begin with an integer ~0 \le N \le 100~, denoting ~N~ teams.
The next ~N~ lines will contain ~S~, ~T~, ~P~, all separated by a single space. ~S~ is the team name, all uppercase letters only, at most 20 letters long. ~T~ is the team type, either
girls. And ~P~ is the number of points that the team has ~0 \le P \le 1\,000\,000~. No two teams will have an equal number of points and no two teams will have the same team name.
The teams to send to ECOO in alphabetical order, each on a separate line, or
No ECOO :( on a single line if no teams are to be sent.
6 A general 1001 H girls 849 G girls 850 B general 999 C general 950 D general 951
A B G
Explanation for Sample Output
Team G is the highest scoring girls team, so they will advance to ECOO. A and B are the two highest scoring general teams, so they also go to ECOO. A, B and G are the three teams that will go in alphabetical order.