



'''simple docstring'''




from __future__ import annotations






def 	_lowerCAmelCase      (  __snake_case  :			list			,							__snake_case  :			int | None = None			,							__snake_case  :			int | None = None      )					->					None:
     if start is None:
          __A						:			Dict								=	0

     if end is None:
          __A						:			List[Any]								=	len(__snake_case      ) - 1

     if start >= end:
          return

     __A						:			List[Any]								=	(start + end) // 2

     slowsort(__snake_case			,							__snake_case			,							__snake_case      )
     slowsort(__snake_case			,							mid + 1			,							__snake_case      )

     if sequence[end] < sequence[mid]:
          __A			,__A						:			List[Any]								=	sequence[mid], sequence[end]

     slowsort(__snake_case			,							__snake_case			,							end - 1      )


if __name__ == "__main__":
  from doctest import testmod

  testmod()






'''simple docstring'''




lowercase__   :				Any      =   {'''a''': ['''c''', '''b'''], '''b''': ['''d''', '''e'''], '''c''': [], '''d''': [], '''e''': []}
lowercase__   :				List[Any]      =   ['''a''', '''b''', '''c''', '''d''', '''e''']






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


if __name__ == "__main__":
  lowercase__   :				Tuple      =   topological_sort('''a''', [], [])
  print(sort)