






'''simple docstring'''






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

import torch_xla.distributed.xla_multiprocessing as xmp




def        _SCREAMING_SNAKE_CASE  (       )    -> int:







   """simple docstring"""
   __snake_case				:      List[str]     							= 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=A  ,		default=1  ,		help='Number of TPU cores to use (1 or 8).'  )

   # positional
   parser.add_argument(
       'training_script'  ,		type=A  ,		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=A  )

   return parser.parse_args()




def        _SCREAMING_SNAKE_CASE  (       )    -> Any:







   """simple docstring"""
   __snake_case				:      Dict     							= parse_args()

   # Import training_script as a module.
   __snake_case				:      List[str]     							= Path(args.training_script  )
   sys.path.append(str(script_fpath.parent.resolve()  )  )
   __snake_case				:      Optional[Any]     							= script_fpath.stem
   __snake_case				:      Optional[int]     							= importlib.import_module(A  )

   # Patch sys.argv
   __snake_case				:      Union[str, Any]     							= [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        _SCREAMING_SNAKE_CASE  (				A  :       list  )    -> list:







   """simple docstring"""
   __snake_case				:      Tuple     							= False
   while is_sorted is False:  # Until all the indices are traversed keep looping
      __snake_case				:      Optional[Any]     							= True
      for i in range(0  ,		len(A  ) - 1  ,		2  ):  # iterating over all even indices
         if input_list[i] > input_list[i + 1]:
            __snake_case							,__snake_case				:      int     							= input_list[i + 1], input_list[i]
            # swapping if elements not in order
            __snake_case				:      List[Any]     							= False

      for i in range(1  ,		len(A  ) - 1  ,		2  ):  # iterating over all odd indices
         if input_list[i] > input_list[i + 1]:
            __snake_case							,__snake_case				:      Tuple     							= input_list[i + 1], input_list[i]
            # swapping if elements not in order
            __snake_case				:      Any     							= False
   return input_list


if __name__ == "__main__":
      print('''Enter list to be sorted''')
      __A    	=   [int(x) for x in input().split()]
      # inputing elements of the list in one line
      __A    	=   odd_even_sort(input_list)
      print('''The sorted list is''')
      print(sorted_list)