


UpperCAmelCase_   :				int						      = {'a': ['c', 'b'], 'b': ['d', 'e'], 'c': [], 'd': [], 'e': []}
UpperCAmelCase_   :				Union[str, Any]						      = ['a', 'b', 'c', 'd', 'e']







def  SCREAMING_SNAKE_CASE_		(    __A				:    Union[str, Any]						,					__A				:    str						,					__A				:    str       )			->	List[str]:

       """simple docstring"""

       a_      :	Optional[Any]							=						start
       # add current to visited
       visited.append(__A       )
       a_      :	str							=						edges[current]
       for neighbor in neighbors:
              # if neighbor not in visited, visit
              if neighbor not in visited:
                     a_      :	List[Any]							=						topological_sort(__A						,					__A						,					__A       )
    # if all neighbors visited add current to sort
       sort.append(__A       )
       # if all vertices haven't been visited select a new one to visit
       if len(__A       ) != len(__A       ):
              for vertice in vertices:
                     if vertice not in visited:
                            a_      :	Optional[int]							=						topological_sort(__A						,					__A						,					__A       )
    # return sort
       return sort


if __name__ == "__main__":
   UpperCAmelCase_   :				Union[str, Any]						      = topological_sort('a', [], [])
   print(sort)






def  SCREAMING_SNAKE_CASE_		(    __A				:    list       )			->	list:

       """simple docstring"""

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

       a_      :	Optional[Any]							=						[]

       def generate(__A				:    int						,					__A				:    list       ):
              a_      :	str							=						[0] * n
              res.append(tuple(__A       )       )

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

       generate(len(__A       )						,					__A       )
       return res


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


