Naming the Team
InterviewTime limit2sMemory limit1024 MB
Given three members' solved counts, admission years, and surnames, print a name from the years mod 100 sorted ascending and another from surname initials sorted by solved count.
- Level
Easy2 of 10
- Topics
- Implementation, Sorting, String
- Solved
- No attempts yet
Problem
Hyundai Mobis runs several talent programs for software developers, including a mobility SW hackathon, an algorithm contest, and a hiring-linked SW academy. The mobility SW hackathon held last February drew 20 teams and about 70 people from software clubs at 14 domestic universities, who competed in mobility software development.
The problem-solving study group SCCC at the School of Computer Science and Engineering, Soongsil University, has to pick a team name every year for team contests such as the mobility SW hackathon, SCON, and ICPC. Seongseo, who graduates one semester from now, wrote a set of guidelines so that members no longer struggle with team names.
According to Seongseo's guidelines, there are two ways to make a team name.
- A string made by sorting the remainders of the three members' admission years divided by 100 in ascending order and concatenating them
- A string made by listing the first letter of each member's surname in English, ordered from the member who solved the most problems on the online judge to the one who solved the fewest
For example, consider a team of AHN admitted in 2018 with 600 solved problems, LEE admitted in 2019 with 2000, and OH admitted in 2020 with 6000. The first method gives 181920, and the second method gives OLA.
A team of LEE admitted in 2019 with 2000 solved problems, NAH admitted in 2021 with 9000, and PARK admitted in 2022 with 1000 gives 192122 with the first method and NLP with the second.
Input
The first line gives the number of problems solved on the online judge by the first member, their admission year , and their surname , separated by spaces.
The second and third lines give and for the second and third members, in the same format as the first line.
Output
Print the team name made by the first method on the first line.
Print the team name made by the second method on the second line.
Constraints
- All are different.
- All are different.
- Surnames consist only of uppercase English letters and have at most 5 letters.
- All surnames are different.
- All numbers in the input are integers.
Hint
181920 is the bronze-medal team at the 2020 ICPC Asia Seoul Regional Contest, and NLP is the silver-medal team at the 2022 ICPC Asia Seoul Regional Contest.