Problem A
Zyxab
Languages
en
is
You ask your friend for a list of names and tell him you will pick the best one, defining the best one to be the shortest word, with ties being broken by which name is larger alphabetically. You furthermore require the name to be at least five characters long and that it has no repeated letter.
Your friend has now produced his list and all that is left is to find the “best” name.
Input
The first line of the input contains an integer $n$, where $1 \leq n \leq 20$. Then follow $n$ lines, each containing a string. The string contains only lowercase letters from the English alphabet and is at most $20$ characters long.
Output
The output should contain the best name if one exists, and “Neibb” otherwise.
Scoring
Group |
Points |
Constraints |
1 |
30 |
The names only consist of the letters “a”, “b”, “c” and “d” |
2 |
70 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
4 monkeys horses zyxab doggies |
zyxab |
Sample Input 2 | Sample Output 2 |
---|---|
5 bergur eylaifur atli androski eilayfur |
eylaifur |
Sample Input 3 | Sample Output 3 |
---|---|
3 abc abcd zzabc |
Neibb |