



'''simple docstring'''


import os
from pathlib import Path






def  UpperCAmelCase_       (		):


					'''simple docstring'''







					from torch.utils.cpp_extension import load

					a_       		=Path(lowercase__       ).resolve().parent.parent.parent / "kernels" / "deformable_detr"
					a_       		=[
					    root / filename
					    for filename in [
					        "vision.cpp",
					        os.path.join("cpu"       ,	"ms_deform_attn_cpu.cpp"       ),
					        os.path.join("cuda"       ,	"ms_deform_attn_cuda.cu"       ),
					    ]
					]

					load(
					    "MultiScaleDeformableAttention"       ,	lowercase__       ,	with_cuda=lowercase__       ,	extra_include_paths=[str(lowercase__       )]       ,	extra_cflags=["-DWITH_CUDA=1"]       ,	extra_cuda_cflags=[
					        "-DCUDA_HAS_FP16=1",
					        "-D__CUDA_NO_HALF_OPERATORS__",
					        "-D__CUDA_NO_HALF_CONVERSIONS__",
					        "-D__CUDA_NO_HALF2_OPERATORS__",
					    ]       ,	)

					import MultiScaleDeformableAttention as MSDA

					return MSDA







'''simple docstring'''


from __future__ import annotations






def  UpperCAmelCase_       (		lowercase__       ):


     '''simple docstring'''







     a_       		=str(lowercase__       )
     return len(lowercase__       ) == 9 and set(lowercase__       ) == set("123456789"       )






def  UpperCAmelCase_       (		):


     '''simple docstring'''







     for base_num in range(9_9_9_9       ,	4_9_9_9       ,	-1       ):
          a_       		=1_0_0_0_0_2 * base_num
          if is_9_pandigital(lowercase__       ):
               return candidate

     for base_num in range(3_3_3       ,	9_9       ,	-1       ):
          a_       		=1_0_0_2_0_0_3 * base_num
          if is_9_pandigital(lowercase__       ):
               return candidate

     return None


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


