





"""simple docstring"""


import importlib
import sys
from argparse import REMAINDER, ArgumentParser
from pathlib import Path

import torch_xla.distributed.xla_multiprocessing as xmp





def 				a__      (	)     ->	Dict:

 '''simple docstring'''






 snake_case__     				=					ArgumentParser(
     description=(
         "PyTorch TPU distributed training launch helper utility that will spawn up multiple distributed processes"
     )						)

 # Optional arguments for the launch helper
 parser.add_argument("--num_cores"						,  type=_UpperCAmelCase						,  default=1						,  help="Number of TPU cores to use (1 or 8)."						)

 # positional
 parser.add_argument(
     "training_script"						,  type=_UpperCAmelCase						,  help=(
         "The full path to the single TPU training "
         "program/script to be launched in parallel, "
         "followed by all the arguments for the "
         "training script"
     )						,  )

 # rest from the training program
 parser.add_argument("training_script_args"						,  nargs=_UpperCAmelCase						)

 return parser.parse_args()





def 				a__      (	)     ->	Any:

 '''simple docstring'''






 snake_case__     				=					parse_args()

 # Import training_script as a module.
 snake_case__     				=					Path(args.training_script						)
 sys.path.append(str(script_fpath.parent.resolve()						)						)
 snake_case__     				=					script_fpath.stem
 snake_case__     				=					importlib.import_module(_UpperCAmelCase						)

 # Patch sys.argv
 snake_case__     				=					[args.training_script] + args.training_script_args + ['--tpu_num_cores', str(args.num_cores						)]

 xmp.spawn(mod._mp_fn						,  args=()						,  nprocs=args.num_cores						)


if __name__ == "__main__":
   main()






"""simple docstring"""




def 	lowercase__  (      )  ->      Any:






      '''simple docstring'''


      lowercase	:   Dict											= 1

      while True:
            if (
                sorted(str(_UpperCAmelCase					)					)
                == sorted(str(2 * i					)					)
                == sorted(str(3 * i					)					)
                == sorted(str(4 * i					)					)
                == sorted(str(5 * i					)					)
                == sorted(str(6 * i					)					)
            ):
                  return i

            i += 1


if __name__ == "__main__":
     print(solution())
