
"""simple docstring"""




__lowerCAmelCase    :							Union[str, 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",
    " ": " ",
}


__lowerCAmelCase    :							str													=						{value: key for key, value in encode_dict.items()}







def 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




		lowerCAmelCase__        =   ''''''
		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 							_UpperCAmelCase		(       lowerCamelCase__     ):





		"""simple docstring"""




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


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

			testmod()





"""simple docstring"""




import os
from math import logaa







def 							_UpperCAmelCase		(       lowerCamelCase__ = "base_exp.txt"     ):





		"""simple docstring"""




		lowerCAmelCase__        =   0
		lowerCAmelCase__        =   0
		for i, line in enumerate(open(os.path.join(os.path.dirname(lowerCamelCase__     )			,  lowerCamelCase__     )     )     ):
				lowerCAmelCase__   ,					lowerCAmelCase__        =   list(map(lowerCamelCase__			,  line.split(""","""     )     )     )
				if x * logaa(lowerCamelCase__     ) > largest:
						lowerCAmelCase__        =   x * logaa(lowerCamelCase__     )
						lowerCAmelCase__        =   i + 1
		return result


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




