The constitution of a country says that the leader is the person whose name contains the greatest number of different letters. The country writes names with the uppercase letters A through Z, and a space inside a name does not count as a letter. For example, GOOGLE contains four different letters: E, G, L and O. APAC CODE JAM contains eight. If those two people are the whole country, the leader is APAC CODE JAM.
If several people have the same number of different letters, the leader is the one whose name comes first in alphabetical order. Names are compared character by character, and a space comes before every letter. For example, A AB C and DEF both contain three different letters, and A AB C comes first, so A AB C is the leader.
Given the names of all citizens, find the leader.