





import functools
from typing import Any





def     _UpperCamelCase     (a__   :str   ,			a__   :list[str]       ):






							"""simple docstring"""





							if not isinstance(a__   ,			a__       ) or len(a__       ) == 0:
														raise ValueError("""the string should be not empty string"""       )

							if not isinstance(a__   ,			a__       ) or not all(
							    isinstance(a__   ,			a__       ) and len(a__       ) > 0 for item in words       ):
														raise ValueError("""the words should be a list of non-empty strings"""       )

							# Build trie
							UpperCamelCase__				     =			{}
							UpperCamelCase__				     =			"""WORD_KEEPER"""

							for word in words:
														UpperCamelCase__				     =			trie
														for c in word:
																					if c not in trie_node:
																												UpperCamelCase__				     =			{}

																					UpperCamelCase__				     =			trie_node[c]

														UpperCamelCase__				     =			True

							UpperCamelCase__				     =			len(a__       )

							# Dynamic programming method
							@functools.cache
							def is_breakable(a__   :int       ) -> bool:
														if index == len_string:
																					return True

														UpperCamelCase__				     =			trie
														for i in range(a__   ,			a__       ):
																					UpperCamelCase__				     =			trie_node.get(string[i]   ,			a__       )

																					if trie_node is None:
																												return False

																					if trie_node.get(a__   ,			a__       ) and is_breakable(i + 1       ):
																												return True

														return False

							return is_breakable(0       )


if __name__ == "__main__":
					import doctest

					doctest.testmod()











from typing import Any





def     _UpperCamelCase     (a__   :list       ):






							"""simple docstring"""





							if not input_list:
														return []
							UpperCamelCase__				     =			[input_list.count(a__       ) for value in input_list]
							UpperCamelCase__				     =			max(a__       )  # Gets the maximum count in the input list.
							# Gets values of modes
							return sorted({input_list[i] for i, value in enumerate(a__       ) if value == y}       )


if __name__ == "__main__":
					import doctest

					doctest.testmod()




