





'''simple docstring'''






def       lowercase_      (		lowercase__						)   ->bool:
						_snake_case:   Tuple  					=		(1 + 24 * n) ** 0.5
						return ((1 + root) / 6) % 1 == 0





def       lowercase_      (		lowercase__ = 5000						)   ->int:
						_snake_case:   List[str]  					=		[(i * (3 * i - 1)) // 2 for i in range(1				,  lowercase__						)]
						for i, pentagonal_i in enumerate(lowercase__						):
												for j in range(lowercase__				,  len(lowercase__						)						):
																		_snake_case:   Tuple  					=		pentagonal_nums[j]
																		_snake_case:   Optional[Any]  					=		pentagonal_i + pentagonal_j
																		_snake_case:   List[str]  					=		pentagonal_j - pentagonal_i
																		if is_pentagonal(lowercase__						) and is_pentagonal(lowercase__						):
																								return b

						return -1


if __name__ == "__main__":
		print(F'{solution() = }')












'''simple docstring'''






A   : str             =			{
    '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',
    ' ': ' ',
}


A   : Union[str, Any]             =			{value: key for key, value in encode_dict.items()}





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


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

		testmod()





