


'''simple docstring'''
from __future__ import annotations


def      a (     __a  )    ->      bool:



					'''simple docstring'''






					UpperCamelCase__  :Union[str, Any]				   =					str(__a  )
					return len(__a  ) == 9 and set(__a  ) == set('''123456789'''  )


def      a (     )    ->      int | None:



					'''simple docstring'''






					for base_num in range(9999					,   4999					,   -1  ):
										UpperCamelCase__  :Union[str, Any]				   =					100002 * base_num
										if is_9_pandigital(__a  ):
															return candidate

					for base_num in range(333					,   99					,   -1  ):
										UpperCamelCase__  :Dict				   =					1002003 * base_num
										if is_9_pandigital(__a  ):
															return candidate

					return None


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



'''simple docstring'''
from __future__ import annotations

import math


def      a (     __a					,   __a					,   __a					,   __a					,   __a  )    ->      int:



					'''simple docstring'''






					if depth < 0:
										raise ValueError('''Depth cannot be less than 0'''  )

					if len(__a  ) == 0:
										raise ValueError('''Scores cannot be empty'''  )

					if depth == height:
										return scores[node_index]

					if is_max:
										return max(
										    minimax(depth + 1					,   node_index * 2					,   __a					,   __a					,   __a  )					,   minimax(depth + 1					,   node_index * 2 + 1					,   __a					,   __a					,   __a  )					,   )

					return min(
					    minimax(depth + 1					,   node_index * 2					,   __a					,   __a					,   __a  )					,   minimax(depth + 1					,   node_index * 2 + 1					,   __a					,   __a					,   __a  )					,   )


def      a (     )    ->      None:



					'''simple docstring'''






					UpperCamelCase__  :str				   =					[90, 23, 6, 33, 21, 65, 123, 34423]
					UpperCamelCase__  :List[Any]				   =					math.log(len(__a  )					,   2  )
					print('''Optimal value : '''					,   end=''''''  )
					print(minimax(0					,   0					,   __a					,   __a					,   __a  )  )


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		main()