'''simple docstring'''






def  _SCREAMING_SNAKE_CASE		(      __snake_case							:			list				):

     if len(__snake_case				) <= 1:
          return [tuple(__snake_case				)]

     _A    		=  []

     def generate(__snake_case							:			int   ,		__snake_case							:			list				):
          if k == 1:
               res.append(tuple(arr[:]				)				)
               return

          generate(k - 1   ,		__snake_case				)

          for i in range(k - 1				):
               if k % 2 == 0:  # k is even
                    _A		,       _A    		=  arr[k - 1], arr[i]
               else:  # k is odd
                    _A		,       _A    		=  arr[k - 1], arr[0]
               generate(k - 1   ,		__snake_case				)

     generate(len(__snake_case				)   ,		__snake_case				)
     return res


if __name__ == "__main__":
   _UpperCAmelCase    :     List[Any]         =       input('''Enter numbers separated by a comma:\n''').strip()
   _UpperCAmelCase    :     Optional[int]         =       [int(item) for item in user_input.split(''',''')]
   print(heaps(arr))




'''simple docstring'''






import os
from pathlib import Path





def  _SCREAMING_SNAKE_CASE		(      ):
     from torch.utils.cpp_extension import load

     _A    		=  Path(__snake_case				).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'   ,		__snake_case   ,		with_cuda=__snake_case   ,		extra_include_paths=[str(__snake_case				)]   ,		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



