
# Lint as: python3

import hashlib
from typing import Union




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  Union[str, int, bytes]					)     ->    bytes:
						if isinstance(SCREAMING_SNAKE_CASE_		,      SCREAMING_SNAKE_CASE_					):
												# Data already in bytes, returns as it as
												return hash_data
						elif isinstance(SCREAMING_SNAKE_CASE_		,      SCREAMING_SNAKE_CASE_					):
												# We keep the data as it as for it ot be later encoded to UTF-8
												# However replace `\\` with `/` for Windows compatibility
												_lowercase									=				hash_data.replace("""\\"""		,      """/"""					)
						elif isinstance(SCREAMING_SNAKE_CASE_		,      SCREAMING_SNAKE_CASE_					):
												_lowercase									=				str(SCREAMING_SNAKE_CASE_					)
						else:
												# If data is not of the required type, raise error
												raise InvalidKeyError(SCREAMING_SNAKE_CASE_					)

						return hash_data.encode("""utf-8"""					)



class       a_   ( _a						):






			def __init__(			self							, __UpperCamelCase     ):
									_lowercase									=				"""\nFAILURE TO GENERATE DATASET: Invalid key type detected"""
									_lowercase									=				f"""\nFound Key {hash_data} of type {type(__UpperCamelCase     )}"""
									_lowercase									=				"""\nKeys should be either str, int or bytes type"""
									super().__init__(f"""{self.prefix}{self.err_msg}{self.suffix}"""     )







class       a_   ( _a						):






			def __init__(			self							, __UpperCamelCase							, __UpperCamelCase							, __UpperCamelCase=""     ):
									_lowercase									=				key
									_lowercase									=				duplicate_key_indices
									_lowercase									=				fix_msg
									_lowercase									=				"""Found multiple examples generated with the same key"""
									if len(__UpperCamelCase     ) <= 20:
															_lowercase									=				f"""\nThe examples at index {", ".join(__UpperCamelCase     )} have the key {key}"""
									else:
															_lowercase									=				f"""\nThe examples at index {", ".join(duplicate_key_indices[:20]     )}... ({len(__UpperCamelCase     ) - 20} more) have the key {key}"""
									_lowercase									=				"""\n""" + fix_msg if fix_msg else """"""
									super().__init__(f"""{self.prefix}{self.err_msg}{self.suffix}"""     )







class       a_   :






			def __init__(			self							, __UpperCamelCase     ):
									_lowercase									=				hashlib.mda(_as_bytes(__UpperCamelCase     )     )






			def       UpperCamelCase_							(			self							, __UpperCamelCase     ):
									_lowercase									=				self._split_mda.copy()
									_lowercase									=				_as_bytes(__UpperCamelCase     )
									mda.update(__UpperCamelCase     )
									# Convert to integer with hexadecimal conversion
									return int(mda.hexdigest()							, 16     )

def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    int:
						return n * (2 * n - 1)




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						_lowercase									=				(1 + 24 * n) ** 0.5
						return ((1 + root) / 6) % 1 == 0




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int = 1_44					)     ->    int:
						_lowercase									=				start
						_lowercase									=				hexagonal_num(SCREAMING_SNAKE_CASE_					)
						while not is_pentagonal(SCREAMING_SNAKE_CASE_					):
												n += 1
												_lowercase									=				hexagonal_num(SCREAMING_SNAKE_CASE_					)
						return num


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