Team Name Selection 2
InterviewTime limit1sMemory limit1024 MB
Given N candidate team names, print the one that has at most 10 characters, no more uppercase than lowercase letters, and at least one non-digit character.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Members of the problem solving study group SCCC in the Department of Computer Science and Engineering at Soongsil University spend a lot of time each year choosing a team name for team contests such as SCON and ICPC. Picking one name from several candidates is especially hard. So Jeonghwi, who has two semesters left before graduation, wrote a guideline to spare the members further trouble.
According to Jeonghwi's guideline, the more of the conditions below a name meets, the better the name is.
- Lowercase letters are cuter than uppercase letters. So uppercase letters must not appear more often than lowercase letters.
- If a team name is too complicated, the host may not read it properly. So a team name must be 10 characters or fewer.
- A team name made up only of digits is said to be jinxed: such a team never reaches the World Finals. So a team name must contain at least one character that is not a digit.
Given team name candidates, write a program that prints the team name that satisfies all three conditions.
Input
The first line contains the number of team name candidates .
From the second line onward, the next lines each contain one candidate .
Output
Print the team name that satisfies all three conditions.
Constraints
- . That is, every candidate is a string of length 20 or less.
- Each consists only of lowercase letters, uppercase letters, digits, and hyphens (
-). - Exactly one team name satisfies all three conditions.
Hints
The ASCII codes of uppercase letters, lowercase letters, digits, and the hyphen are 65 to 90, 97 to 122, 48 to 57, and 45, respectively.
181920 is the bronze medal team at the 2020 ICPC Asia Seoul Regional Contest.
LongestPathToWF is a bronze medal team at the 2021 ICPC Asia Seoul Regional Contest and advanced to the 2022 ICPC World Finals.
NLP is a silver medal team at the 2022 ICPC Asia Seoul Regional Contest and advanced to the 2023 ICPC World Finals.
PS akgwi won a silver medal at the 2023 ICPC Asia Seoul Regional Contest and a silver medal at the 2024 ICPC Asia Pacific Championship, and advanced to the 2024 ICPC World Finals.