def __a (	__lowerCamelCase			:						Optional[Any]				)	->							List[Any]:
      '''simple docstring'''


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

      lowercase_     =      []

      def generate(__lowerCamelCase			:						List[Any] ,		__lowerCamelCase			:						Dict				):
            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
                        lowercase_ ,							lowercase_     =      arr[k - 1], arr[i]
                  else:  # k is odd
                        lowercase_ ,							lowercase_     =      arr[k - 1], arr[0]
                  generate(k - 1 ,		__snake_case				)

      generate(len(__snake_case				) ,		__snake_case				)
      return res


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







'''simple docstring'''

from __future__ import annotations


def __a (	__lowerCamelCase			:						list[list[int]]				)	->							bool:
      '''simple docstring'''


      lowercase_     =      len(__lowerCamelCase				)
      # We need to create solution object to save path.
      lowercase_     =      [[0 for _ in range(__lowerCamelCase				)] for _ in range(__lowerCamelCase				)]
      lowercase_     =      run_maze(__lowerCamelCase ,		0 ,		0 ,		__lowerCamelCase				)
      if solved:
            print("\n".join(str(__lowerCamelCase				) for row in solutions				)				)
      else:
            print("No solution exists!"				)
      return solved


def __a (	__lowerCamelCase			:						list[list[int]] ,		__lowerCamelCase			:						int ,		__lowerCamelCase			:						int ,		__lowerCamelCase			:						list[list[int]]				)	->							bool:
      '''simple docstring'''


      lowercase_     =      len(__lowerCamelCase				)
      # Final check point.
      if i == j == (size - 1):
            lowercase_     =      1
            return True

      lowercase_     =      (not i < 0) and (not j < 0)  # Check lower bounds
      lowercase_     =      (i < size) and (j < size)  # Check upper bounds

      if lower_flag and upper_flag:
            # check for already visited and block points.
            lowercase_     =      (not solutions[i][j]) and (not maze[i][j])
            if block_flag:
                  # check visited
                  lowercase_     =      1

                  # check for directions
                  if (
                      run_maze(__lowerCamelCase ,		i + 1 ,		__lowerCamelCase ,		__lowerCamelCase				)
                      or run_maze(__lowerCamelCase ,		__lowerCamelCase ,		j + 1 ,		__lowerCamelCase				)
                      or run_maze(__lowerCamelCase ,		i - 1 ,		__lowerCamelCase ,		__lowerCamelCase				)
                      or run_maze(__lowerCamelCase ,		__lowerCamelCase ,		j - 1 ,		__lowerCamelCase				)
                  ):
                        return True

                  lowercase_     =      0
                  return False
      return False


if __name__ == "__main__":
       import doctest

       doctest.testmod()






