



def     UpperCamelCase(						__UpperCamelCase							:	int = 998001				):
		lowerCAmelCase_    :  Tuple             =				0
		for i in range(999  ,99  ,-1				):  # 3 digit numbers range from 999 down to 100
				for j in range(999  ,99  ,-1				):
						lowerCAmelCase_    :  List[Any]             =				str(i * j				)
						if product_string == product_string[::-1] and i * j < n:
								lowerCAmelCase_    :  int             =				max(__UpperCamelCase  ,i * j				)
		return answer


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










from __future__ import annotations

A__						:						Tuple          =      '''Alexander Joslin'''


def     UpperCamelCase(						__UpperCamelCase							:	int				):

		if number <= 0:
				lowerCAmelCase_    :  str             =				f"""n must be greater than 0. Got n = {number}"""
				raise ValueError(__UpperCamelCase				)

		lowerCAmelCase_    :  str             =				[number + 1] * (number + 1)

		# starting position
		lowerCAmelCase_    :  List[Any]             =				0
		for i in range(1  ,__UpperCamelCase				):
				lowerCAmelCase_    :  int             =				min(table[i + 1]  ,table[i] + 1				)
				# check if out of bounds
				if i * 2 <= number:
						lowerCAmelCase_    :  Union[str, Any]             =				min(table[i * 2]  ,table[i] + 1				)
				# check if out of bounds
				if i * 3 <= number:
						lowerCAmelCase_    :  Union[str, Any]             =				min(table[i * 3]  ,table[i] + 1				)
		return table[number]


if __name__ == "__main__":
						import doctest

						doctest.testmod()





