





"""simple docstring"""


import logging
import os
from logging import (
    CRITICAL,  # NOQA
    DEBUG,  # NOQA
    ERROR,  # NOQA
    FATAL,  # NOQA
    INFO,  # NOQA
    NOTSET,  # NOQA
    WARN,  # NOQA
    WARNING,  # NOQA
)
from typing import Optional

from tqdm import auto as tqdm_lib


lowerCamelCase__						= {
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING,
    "error": logging.ERROR,
    "critical": logging.CRITICAL,
}

lowerCamelCase__						= logging.WARNING




def        lowercase__     (       )       ->		Tuple:




      """simple docstring"""

      _UpperCamelCase   :						List[str]    =							os.getenv("DATASETS_VERBOSITY"		,lowercase_      )
      if env_level_str:
            if env_level_str in log_levels:
                  return log_levels[env_level_str]
            else:
                  logging.getLogger().warning(
                      F'''Unknown option DATASETS_VERBOSITY={env_level_str}, '''
                      F'''has to be one of: { ', '.join(log_levels.keys()      ) }'''      )
      return _default_log_level




def        lowercase__     (       )       ->		str:




      """simple docstring"""

      return __name__.split("."      )[0]




def        lowercase__     (       )       ->		logging.Logger:




      """simple docstring"""

      return logging.getLogger(_get_library_name()      )




def        lowercase__     (       )       ->		None:




      """simple docstring"""

      _UpperCamelCase   :						List[Any]    =							_get_library_root_logger()
      library_root_logger.setLevel(_get_default_logging_level()      )




def        lowercase__     (       )       ->		None:




      """simple docstring"""

      _UpperCamelCase   :						List[str]    =							_get_library_root_logger()
      library_root_logger.setLevel(logging.NOTSET      )




def        lowercase__     (       lowercase_ = None      )       ->		logging.Logger:




      """simple docstring"""

      if name is None:
            _UpperCamelCase   :						Any    =							_get_library_name()
      return logging.getLogger(lowercase_      )




def        lowercase__     (       )       ->		int:




      """simple docstring"""

      return _get_library_root_logger().getEffectiveLevel()




def        lowercase__     (       lowercase_      )       ->		None:




      """simple docstring"""

      _get_library_root_logger().setLevel(lowercase_      )




def        lowercase__     (       )       ->		List[Any]:




      """simple docstring"""

      return set_verbosity(lowercase_      )




def        lowercase__     (       )       ->		List[Any]:




      """simple docstring"""

      return set_verbosity(lowercase_      )




def        lowercase__     (       )       ->		int:




      """simple docstring"""

      return set_verbosity(lowercase_      )




def        lowercase__     (       )       ->		Optional[int]:




      """simple docstring"""

      return set_verbosity(lowercase_      )




def        lowercase__     (       )       ->		None:




      """simple docstring"""

      _UpperCamelCase   :						int    =							False




def        lowercase__     (       )       ->		None:




      """simple docstring"""

      _UpperCamelCase   :						Tuple    =							True


# Configure the library root logger at the module level (singleton-like)
_configure_library_root_logger()



class   __SCREAMING_SNAKE_CASE     :







  '''simple docstring'''


  def __init__(		self :							Tuple       , *__a :							Optional[int]       , **__a :							List[Any]						)		->					Optional[int]:  # pylint: disable=unused-argument
        _UpperCamelCase   :						Dict    =							args[0] if args else None

  def __iter__(		self :							Any						)		->					Any:
        return iter(self._iterator						)

  def __getattr__(		self :							str       , __a :							Dict						)		->					Optional[int]:

        def empty_fn(*__a :							Optional[int]       , **__a :							Optional[Any]						):  # pylint: disable=unused-argument
              return

        return empty_fn

  def __enter__(		self :							Any						)		->					Tuple:
        return self


  def __exit__(		self :							str       , __a :							Tuple       , __a :							Dict       , __a :							int						)		->					str:
        return





lowerCamelCase__						= True



class   __SCREAMING_SNAKE_CASE     :







  '''simple docstring'''


  def __call__(		self :							Union[str, Any]       , *__a :							List[str]       , __a :							Optional[int]=False       , **__a :							int						)		->					Union[str, Any]:
        if _tqdm_active and not disable:
              return tqdm_lib.tqdm(*__a       , **__a						)
        else:
              return EmptyTqdm(*__a       , **__a						)

  def  __SCREAMING_SNAKE_CASE					(		self :							List[str]       , *__a :							List[Any]       , **__a :							int						)		->					int:
        _UpperCamelCase   :						Any    =							None
        if _tqdm_active:
              return tqdm_lib.tqdm.set_lock(*__a       , **__a						)


  def  __SCREAMING_SNAKE_CASE					(		self :							Union[str, Any]						)		->					Union[str, Any]:
        if _tqdm_active:
              return tqdm_lib.tqdm.get_lock()





lowerCamelCase__						= _tqdm_cls()




def        lowercase__     (       )       ->		bool:




      """simple docstring"""

      global _tqdm_active
      return bool(_tqdm_active      )




def        lowercase__     (       )       ->		str:




      """simple docstring"""

      global _tqdm_active
      _UpperCamelCase   :						int    =							True




def        lowercase__     (       )       ->		Tuple:




      """simple docstring"""

      global _tqdm_active
      _UpperCamelCase   :						List[Any]    =							False







"""simple docstring"""


def        lowercase__     (       lowercase_      )       ->		list:




      """simple docstring"""

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

      _UpperCamelCase   :						Optional[Any]    =							[]

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

            generate(k - 1		,lowercase_      )

            for i in range(k - 1      ):
                  if k % 2 == 0:  # k is even
                        _UpperCamelCase,	_UpperCamelCase   :						List[str]    =							arr[k - 1], arr[i]
                  else:  # k is odd
                        _UpperCamelCase,	_UpperCamelCase   :						int    =							arr[k - 1], arr[0]
                  generate(k - 1		,lowercase_      )

      generate(len(lowercase_      )		,lowercase_      )
      return res


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