

'''simple docstring'''

lowercase__         =      {
    "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__         =      {value: key for key, value in encode_dict.items()}




def 				UpperCamelCase(					UpperCAmelCase_     ):
 UpperCAmelCase	:     List[str]						 =			''
 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(					UpperCAmelCase_     ):
 if set(UpperCAmelCase_     ) - {"A", "B", " "} != set():
  raise Exception('decode() accepts only \'A\', \'B\' and spaces'     )
 UpperCAmelCase	:     int						 =			''
 for word in coded.split():
  while len(UpperCAmelCase_     ) != 0:
   decoded += decode_dict[word[:5]]
   UpperCAmelCase	:     Any						 =			word[5:]
  decoded += " "
 return decoded.strip()


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

 testmod()







'''simple docstring'''

def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
 while a != 0:
  UpperCAmelCase ,			UpperCAmelCase	:     Tuple						 =			b % a, a
 return b




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
 if gcd(UpperCAmelCase_  ,	UpperCAmelCase_     ) != 1:
  UpperCAmelCase	:     List[str]						 =			F"""mod inverse of {a!r} and {m!r} does not exist"""
  raise ValueError(UpperCAmelCase_     )
 UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase	:     Any						 =			1, 0, a
 UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase	:     Dict						 =			0, 1, m
 while va != 0:
  UpperCAmelCase	:     Tuple						 =			ua // va
  UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase	:     List[Any]						 =			(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
 return ua % m




