Problem G
Zyxab
You really like playing games with your friend. Having played all the games there are, you decide to make your own game. After toiling over the rules and layout you realize you left nothing for your friend to do. You placate your friend, after some squabbling, by letting them choose a name for the game. You had already grown fond of the name Zyxab, so you decide to stack the deck in your favour. 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 conatains an integer $1 \leq n \leq 20$. Then follow $n$ lines, each containing a string. The string contains only lowercase letters and is at most $20$ characters long.
Output
The output should contain the best name if one exists, and “neibb!” otherwise.
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! |