
'''simple docstring'''

from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
    if not (is_transformers_available() and is_torch_available()):
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    from ...utils.dummy_torch_and_transformers_objects import KandinskyPipeline, KandinskyPriorPipeline
else:
    from .pipeline_kandinsky import KandinskyPipeline
    from .pipeline_kandinsky_imgaimg import KandinskyImgaImgPipeline
    from .pipeline_kandinsky_inpaint import KandinskyInpaintPipeline
    from .pipeline_kandinsky_prior import KandinskyPriorPipeline, KandinskyPriorPipelineOutput
    from .text_encoder import MultilingualCLIP




'''simple docstring'''

def 	_snake_case						(      A_       :    list   ):
  """simple docstring"""







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

  a_      :	List[Any]      =							[]

  def generate(A_       :    int     ,		A_       :    list   ):
    a_      :	List[Any]      =							[0] * n
    res.append(tuple(A_   )   )

    a_      :	List[str]      =							0
    while i < n:
      if c[i] < i:
        if i % 2 == 0:
          a_      , a_      :	Union[str, Any]      =							arr[i], arr[0]
        else:
          a_      , a_      :	List[str]      =							arr[i], arr[c[i]]
        res.append(tuple(A_   )   )
        c[i] += 1
        a_      :	Optional[Any]      =							0
      else:
        a_      :	Union[str, Any]      =							0
        i += 1

  generate(len(A_   )     ,		A_   )
  return res


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


