


def      lowerCAmelCase	(						lowerCAmelCase_ = 998_001	)->	int:

				# fetches the next number
				for number in range(n - 1	,				9_999	,				-1	):
								lowerCAmelCase_	: Tuple      			=			str(lowerCAmelCase_	)

								# checks whether 'str_number' is a palindrome.
								if str_number == str_number[::-1]:
												lowerCAmelCase_	: Optional[Any]      			=			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() = }""")



from __future__ import annotations



def      lowerCAmelCase	(						lowerCAmelCase_	,				lowerCAmelCase_	,				lowerCAmelCase_	)->	int | float:
				if len(lowerCAmelCase_	) == 0:
								raise ValueError('''find_min() arg is an empty sequence'''	)
				if (
				    left >= len(lowerCAmelCase_	)
				    or left < -len(lowerCAmelCase_	)
				    or right >= len(lowerCAmelCase_	)
				    or right < -len(lowerCAmelCase_	)
				):
								raise IndexError('''list index out of range'''	)
				if left == right:
								return nums[left]
				lowerCAmelCase_	: Any      			=			(left + right) >> 1  # the middle
				lowerCAmelCase_	: Tuple      			=			find_min(lowerCAmelCase_	,				lowerCAmelCase_	,				lowerCAmelCase_	)  # find min in range[left, mid]
				lowerCAmelCase_	: Any      			=			find_min(lowerCAmelCase_	,				mid + 1	,				lowerCAmelCase_	)  # find min in range[mid + 1, right]

				return left_min if left_min <= right_min else right_min


if __name__ == "__main__":
						import doctest

						doctest.testmod(verbose=True)