



def 			UpperCAmelCase__     (     lowercase__ = 998_001 )			->   int:

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

												# checks whether 'str_number' is a palindrome.
												if str_number == str_number[::-1]:
																		__lowercase											=					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 .stack import Stack






def 			UpperCAmelCase__     (     lowercase__ )			->   bool:
						__lowercase											=					Stack()
						__lowercase											=					{"""(""": """)""", """[""": """]""", """{""": """}"""}
						for bracket in parentheses:
												if bracket in bracket_pairs:
																		stack.push(lowercase__ )
												elif bracket in (")", "]", "}"):
																		if stack.is_empty() or bracket_pairs[stack.pop()] != bracket:
																								return False
						return stack.is_empty()


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

			testmod()

			UpperCamelCase__			=    ["((()))", "((())", "(()))"]
			print("Balanced parentheses demonstration:\n")
			for example in examples:
						UpperCamelCase__			=    "" if balanced_parentheses(example) else "not "
						print(F"""{example} is {not_str}balanced""")





