
class   UpperCAmelCase		:



   def __init__(self		:					Dict    ,						snake_case__		:					Optional[Any] )		->	List[Any]:


          '''simple docstring'''


          snake_case       :   Optional[int]							=      val
          snake_case       :   Any							=      None
          snake_case       :   Tuple							=      None



   def 				_SCREAMING_SNAKE_CASE   (self		:					Tuple    ,						snake_case__		:					str )		->	Tuple:


          '''simple docstring'''


          if self.val:
                 if val < self.val:
                        if self.left is None:
                               snake_case       :   Any							=      Node(snake_case__ )
                        else:
                               self.left.insert(snake_case__ )
                 elif val > self.val:
                        if self.right is None:
                               snake_case       :   Tuple							=      Node(snake_case__ )
                        else:
                               self.right.insert(snake_case__ )
          else:
                 snake_case       :   Optional[Any]							=      val



def 			UpperCamelCase					(    __lowerCamelCase     : Union[str, Any]				,					__lowerCamelCase     : int    ):
       # Recursive traversal
       if root:
              inorder(root.left				,					__lowerCamelCase    )
              res.append(root.val    )
              inorder(root.right				,					__lowerCamelCase    )


def 			UpperCamelCase					(    __lowerCamelCase     : Tuple    ):
       # Build BST
       if len(__lowerCamelCase    ) == 0:
              return arr
       snake_case       :   Optional[int]							=      Node(arr[0]    )
       for i in range(1				,					len(__lowerCamelCase    )    ):
              root.insert(arr[i]    )
       # Traverse BST in order.
       snake_case       :   Optional[int]							=      []
       inorder(__lowerCamelCase				,					__lowerCamelCase    )
       return res


if __name__ == "__main__":
   print(tree_sort([10, 1, 3, 2, 9, 14, 13]))











"""simple docstring"""


def 					UpperCAmelCase__       (snake_case__							:					list    ):
  """simple docstring"""

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

  _snake_case							:		List[Any]								=  []

  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
        _snake_case		,					_snake_case							:		Optional[Any]								=  arr[k - 1], arr[i]
      else:  # k is odd
        _snake_case		,					_snake_case							:		List[str]								=  arr[k - 1], arr[0]
      generate(k - 1		,   snake_case__    )

  generate(len(snake_case__    )		,   snake_case__    )
  return res


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


