




from __future__ import annotations







def 				lowerCAmelCase_	(     snake_case_     ):
      if len(_UpperCAmelCase     ) == 0:
            return []
      _A							:     Union[str, Any]			=						min(_UpperCAmelCase     ), max(_UpperCAmelCase     )
      _A							:     Dict			=						int(max_value - min_value     ) + 1
      _A							:     list[list]			=						[[] for _ in range(_UpperCAmelCase     )]

      for i in my_list:
            buckets[int(i - min_value     )].append(_UpperCAmelCase     )

      return [v for bucket in buckets for v in sorted(_UpperCAmelCase     )]


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

  testmod()
  assert bucket_sort([4, 5, 3, 2, 1]) == [1, 2, 3, 4, 5]
  assert bucket_sort([0, 1, -10, 15, 2, -2]) == [-10, -2, 0, 1, 2, 15]




def 			A_      (    _UpperCAmelCase    ):
						SCREAMING_SNAKE_CASE_: List[str]  		=       [0] * len(_UpperCAmelCase    )
						SCREAMING_SNAKE_CASE_: List[Any]  		=       []
						SCREAMING_SNAKE_CASE_: str  		=       []
						SCREAMING_SNAKE_CASE_: List[str]  		=       0

						for values in graph.values():
												for i in values:
																		indegree[i] += 1

						for i in range(len(_UpperCAmelCase    )    ):
												if indegree[i] == 0:
																		queue.append(_UpperCAmelCase    )

						while queue:
												SCREAMING_SNAKE_CASE_: Optional[int]  		=       queue.pop(0    )
												cnt += 1
												topo.append(_UpperCAmelCase    )
												for x in graph[vertex]:
																		indegree[x] -= 1
																		if indegree[x] == 0:
																								queue.append(_UpperCAmelCase    )

						if cnt != len(_UpperCAmelCase    ):
												print("Cycle exists"    )
						else:
												print(_UpperCAmelCase    )


# Adjacency List of Graph
lowerCAmelCase							:  Any   	=						{0: [1, 2], 1: [3], 2: [3], 3: [4, 5], 4: [], 5: []}



topological_sort(graph)






