

from collections import defaultdict







def  UpperCAmelCase_   (_lowerCAmelCase :		int = 5		):
			__UpperCamelCase    :    Dict								=      defaultdict(_lowerCAmelCase		)
			__UpperCamelCase    :    Union[str, Any]								=      0

			while True:
						__UpperCamelCase    :    Dict								=      get_digits(_lowerCAmelCase		)
						freqs[digits].append(_lowerCAmelCase		)

						if len(freqs[digits]		) == max_base:
									__UpperCamelCase    :    Dict								=      freqs[digits][0] ** 3
									return base

						num += 1







def  UpperCAmelCase_   (_lowerCAmelCase :		int		):
			return "".join(sorted(str(num**3		)		)		)


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


from __future__ import annotations







def  UpperCAmelCase_   (_lowerCAmelCase :		int     ,			_lowerCAmelCase :		list[int]     ,			_lowerCAmelCase :		list[int]     ,			_lowerCAmelCase :		int		):

			# Base Case
			if counter == 0 or capacity == 0:
						return 0

			# If weight of the nth item is more than Knapsack of capacity,
			#   then this item cannot be included in the optimal solution,
			# else return the maximum of two cases:
			#   (1) nth item included
			#   (2) not included
			if weights[counter - 1] > capacity:
						return knapsack(_lowerCAmelCase     ,			_lowerCAmelCase     ,			_lowerCAmelCase     ,			counter - 1		)
			else:
						__UpperCamelCase    :    Tuple								=      capacity - weights[counter - 1]
						__UpperCamelCase    :    List[str]								=      values[counter - 1] + knapsack(
						    _lowerCAmelCase     ,			_lowerCAmelCase     ,			_lowerCAmelCase     ,			counter - 1		)
						__UpperCamelCase    :    Dict								=      knapsack(_lowerCAmelCase     ,			_lowerCAmelCase     ,			_lowerCAmelCase     ,			counter - 1		)
						return max(_lowerCAmelCase     ,			_lowerCAmelCase		)


if __name__ == "__main__":
					import doctest

					doctest.testmod()