



"""simple docstring"""






_lowercase				:				List[Any]   		=		{
    "a": "AAAAA",
    "b": "AAAAB",
    "c": "AAABA",
    "d": "AAABB",
    "e": "AABAA",
    "f": "AABAB",
    "g": "AABBA",
    "h": "AABBB",
    "i": "ABAAA",
    "j": "BBBAA",
    "k": "ABAAB",
    "l": "ABABA",
    "m": "ABABB",
    "n": "ABBAA",
    "o": "ABBAB",
    "p": "ABBBA",
    "q": "ABBBB",
    "r": "BAAAA",
    "s": "BAAAB",
    "t": "BAABA",
    "u": "BAABB",
    "v": "BBBAB",
    "w": "BABAA",
    "x": "BABAB",
    "y": "BABBA",
    "z": "BABBB",
    " ": " ",
}


_lowercase				:				int   		=		{value: key for key, value in encode_dict.items()}






def   snake_case__     (	__lowerCamelCase       :					str			):
			"""simple docstring"""
			lowerCamelCase__	:	Tuple				=''''''
			for letter in word.lower():
						if letter.isalpha() or letter == " ":
									encoded += encode_dict[letter]
						else:
									raise Exception('''encode() accepts only letters of the alphabet and spaces'''			)
			return encoded






def   snake_case__     (	__lowerCamelCase       :					str			):
			"""simple docstring"""
			if set(__lowerCamelCase			) - {"A", "B", " "} != set():
						raise Exception('''decode() accepts only \'A\', \'B\' and spaces'''			)
			lowerCamelCase__	:	Dict				=''''''
			for word in coded.split():
						while len(__lowerCamelCase			) != 0:
									decoded += decode_dict[word[:5]]
									lowerCamelCase__	:	str				=word[5:]
						decoded += " "
			return decoded.strip()


if __name__ == "__main__":
		from doctest import testmod

		testmod()









"""simple docstring"""






import os






def   snake_case__     (	):
			"""simple docstring"""
			with open(os.path.dirname(__lowerCamelCase			) + '''/p022_names.txt'''			) as file:
						lowerCamelCase__	:	Tuple				=str(file.readlines()[0]			)
						lowerCamelCase__	:	int				=names.replace('''"'''							,	''''''			).split(''','''			)

			names.sort()

			lowerCamelCase__	:	Union[str, Any]				=0
			lowerCamelCase__	:	str				=0

			for i, name in enumerate(__lowerCamelCase			):
						for letter in name:
									name_score += ord(__lowerCamelCase			) - 64

						total_score += (i + 1) * name_score
						lowerCamelCase__	:	Dict				=0
			return total_score


if __name__ == "__main__":
		print(solution())




