




UpperCamelCase__  =		{
    '0': 1,
    '1': 1,
    '2': 2,
    '3': 6,
    '4': 2_4,
    '5': 1_2_0,
    '6': 7_2_0,
    '7': 5_0_4_0,
    '8': 4_0_3_2_0,
    '9': 3_6_2_8_8_0,
}

UpperCamelCase__  =		{1_4_5: 1_4_5}

UpperCamelCase__  =		{
    1_4_5: 0,
    1_6_9: 3,
    3_6_3_0_1: 3,
    1_4_5_4: 3,
    8_7_1: 2,
    4_5_3_6_1: 2,
    8_7_2: 2,
}






def       snake_case      (							A    )							->							int:




	'''simple docstring'''


	if n in CACHE_SUM_DIGIT_FACTORIALS:
		return CACHE_SUM_DIGIT_FACTORIALS[n]
	lowerCamelCase_							:	str							     =							sum(DIGIT_FACTORIALS[let] for let in str(A    )    )
	lowerCamelCase_							:	int							     =							ret
	return ret






def       snake_case      (							A		,     A = None    )							->							int:




	'''simple docstring'''


	lowerCamelCase_							:	Union[str, Any]							     =							previous or set()
	if n in CHAIN_LENGTH_CACHE:
		return CHAIN_LENGTH_CACHE[n]
	lowerCamelCase_							:	List[str]							     =							sum_digit_factorials(A    )
	if next_number in previous:
		lowerCamelCase_							:	int							     =							0
		return 0
	else:
		previous.add(A    )
		lowerCamelCase_							:	Optional[int]							     =							1 + chain_length(A		,     A    )
		lowerCamelCase_							:	str							     =							ret
		return ret






def       snake_case      (							A = 60		,     A = 1000000    )							->							int:




	'''simple docstring'''


	return sum(1 for i in range(1		,     A    ) if chain_length(A    ) == num_terms    )


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






def       snake_case      (							A = 998001    )							->							int:




	'''simple docstring'''


	for number in range(n - 1		,     9999		,     -1    ):
		lowerCamelCase_							:	Tuple							     =							str(A    )

		# checks whether 'str_number' is a palindrome.
		if str_number == str_number[::-1]:
			lowerCamelCase_							:	Tuple							     =							999

			# if 'number' is a product of two 3-digit numbers
			# then number is the answer otherwise fetch next number.
			while divisor != 99:
				if (number % divisor == 0) and (len(str(number // divisor    )    ) == 3.0):
					return number
				divisor -= 1
	raise ValueError('That number is larger than our acceptable range.'    )


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