
"""simple docstring"""






from math import factorial

__UpperCAmelCase       =  {str(d): factorial(d) for d in range(10)}






def 						_snake_case       (	lowercase__		:  int		)  ->				int:


			'''simple docstring'''





			return sum(DIGIT_FACTORIAL[d] for d in str(lowercase__		)		)






def 						_snake_case       (	)  ->				int:


			'''simple docstring'''





			lowerCAmelCase_    :List[str]			     =  7 * factorial(9		) + 1
			return sum(i for i in range(3      ,     lowercase__		) if sum_of_digit_factorial(lowercase__		) == i		)


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











'''simple docstring'''




def 				lowerCAmelCase_   (	_lowerCamelCase:   list					):
		if any(not isinstance(_lowerCamelCase       ,      _lowerCamelCase					) or x < 0 for x in sequence					):
				raise TypeError("""Sequence must be list of non-negative integers"""					)
		for _ in range(len(_lowerCamelCase					)					):
				for i, (rod_upper, rod_lower) in enumerate(zip(_lowerCamelCase       ,      sequence[1:]					)					):
						if rod_upper > rod_lower:
								sequence[i] -= rod_upper - rod_lower
								sequence[i + 1] += rod_upper - rod_lower
		return sequence


if __name__ == "__main__":
						assert bead_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]
						assert bead_sort([7, 9, 4, 3, 5]) == [3, 4, 5, 7, 9]