






from math import factorial

UpperCamelCase								=		{str(digit): factorial(digit) for digit in range(10)}






def    __magic_name__    (	SCREAMING_SNAKE_CASE				)     ->    int:
							if not isinstance(SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				):
														raise TypeError('Parameter number must be int'				)

							if number < 0:
														raise ValueError('Parameter number must be greater than or equal to 0'				)

							# Converts number in string to iterate on its digits and adds its factorial.
							return sum(DIGIT_FACTORIAL[digit] for digit in str(SCREAMING_SNAKE_CASE				)				)






def    __magic_name__    (	SCREAMING_SNAKE_CASE = 60     ,     SCREAMING_SNAKE_CASE = 1_000_000				)     ->    int:

							if not isinstance(SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				) or not isinstance(SCREAMING_SNAKE_CASE     ,     SCREAMING_SNAKE_CASE				):
														raise TypeError('Parameters chain_length and number_limit must be int'				)

							if chain_length <= 0 or number_limit <= 0:
														raise ValueError(
														    'Parameters chain_length and number_limit must be greater than 0'				)

							# the counter for the chains with the exact desired length
							_lowercase							:   Tuple 							=   0
							# the cached sizes of the previous chains
							_lowercase							:   dict[int, int] 							=   {}

							for start_chain_element in range(1     ,     SCREAMING_SNAKE_CASE				):
														# The temporary set will contain the elements of the chain
														_lowercase							:   Dict 							=   set()
														_lowercase							:   Union[str, Any] 							=   0

														# Stop computing the chain when you find a cached size, a repeating item or the
														# length is greater then the desired one.
														_lowercase							:   Tuple 							=   start_chain_element
														while (
														    chain_element not in chain_sets_lengths
														    and chain_element not in chain_set
														    and chain_set_length <= chain_length
														):
																					chain_set.add(SCREAMING_SNAKE_CASE				)
																					chain_set_length += 1
																					_lowercase							:   int 							=   digit_factorial_sum(SCREAMING_SNAKE_CASE				)

														if chain_element in chain_sets_lengths:
																					chain_set_length += chain_sets_lengths[chain_element]

														_lowercase							:   str 							=   chain_set_length

														# If chain contains the exact amount of elements increase the counter
														if chain_set_length == chain_length:
																					chains_counter += 1

							return chains_counter


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							print(f'''{solution()}''')







from __future__ import annotations


def 					_UpperCAmelCase				(						a__):

			'''simple docstring'''



			if len(a__) == 0:
						return []
			a_							,					a_						:						List[Any] 							= min(a__), max(a__)
			a_						:						Tuple 							= int(max_value - min_value) + 1
			a_						:						list[list] 							= [[] for _ in range(a__)]

			for i in my_list:
						buckets[int(i - min_value)].append(a__)

			return [v for bucket in buckets for v in sorted(a__)]


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

	testmod()
	assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
	assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]


