Thomas Stedman Whitwell (1784-1840) was an English architect and civil engineer, best known for his design of the secular communal utopia at New Harmony, Indiana, USA. This was done in close collaboration with the mill owner and social reformer Robert Owen, but their plans remained unrealized.

Whitwell's short stay at New Harmony allowed him to publish in the New Harmony Gazette a proposal for a new system of town naming according to their position. Whitwell thought it illogical and confusing that different towns sometimes have the same name. He suggested assigning each city a unique name that was composed of two words separated by a space. The first word corresponds to the latitude of the city, and the second word to its longitude. Latitude and longitude were converted to words by traversing each coordinate from left to right and converting each digit to the corresponding letters in this table Whitwell published in the New Harmony Gazette in 1826.

1 2 3 4 5 6 7 8 9 0
a e i o u y ee ei ie ou
b d f k l m n p r t

Selection of letters alternates between the first and second rows of the table, which guarantees that the generated words have alternating consonants and vowels. Words that correspond to latitudes in the southern hemisphere start with an S, and words corresponding to western longitudes start with a V. No extra letter is added at the beginning of the words corresponding to north latitudes and east longitudes, so that these words start with a vowel.

Thus New Harmony (USA; 38°11'N, 87°55'W) would be rechristened Ipab Veinul. Washington DC (USA; 38°90'N, 77°04'W) would become Ipiet Veenouk, Brussels (Belgium; 50°85'N, 4°35'O) would be Uteil Ofu, Kampala (Uganda; 0°32'N, 32°58'O) would be Oufe Idup and Buenos Aires (Argentina; 34°61'Z, 58°38'O) would be Sikyb Upip. What these names lack in poetry they make up in utility: a traveler given the name of a town can immediately infer its location. Unfortunately, Whitwell's scheme never caught on — and today the United States has 28 Springfields, 29 Clintons, and 30 Franklins.

Assignment

Determine a city's name based on its position according to Thomas Stedman Whitwell's scheme. In order to do so, you have to

Example

>>> digit2letters(3)
'i'
>>> digit2letters(7, False)
'n'
>>> digit2letters(0, first=False)
't'

>>> coord2word("38°11'N")
'Ipab'
>>> coord2word("87°55'W")
'Veinul'

>>> placename("38°11'N", "87°55'W")   # New Harmony
'Ipab Veinul'
>>> placename("38°11'N, 87°55'W")     # New Harmony
'Ipab Veinul'
>>> placename("38°90'N", "77°04'W")   # Washington DC (VSA)
'Ipiet Veenouk'
>>> placename("50°85'N, 4°35'E")      # Brussels (Belgium)
'Uteil Ofu'
>>> placename("0°32'N", "32°58'E")    # Kampala (Uganda)
'Oufe Idup'
>>> placename("34°61'S, 58°38'E")     # Buenos Aires (Argentina)
'Sikyb Upip'