
'''simple docstring'''







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			Optional[int]:
	_snake_case     		=	[0] * len(__A			)
	_snake_case     		=	[]
	_snake_case     		=	[]
	_snake_case     		=	0

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

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

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

	if cnt != len(__A			):
		print('Cycle exists'			)
	else:
		print(__A			)


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





topological_sort(graph)



'''simple docstring'''







from abc import ABC, abstractmethod
from argparse import ArgumentParser


class 		__UpperCAmelCase   (      _lowerCamelCase		):


							@staticmethod
							@abstractmethod
							def 				lowerCamelCase       ( lowerCAmelCase_						):





								"""simple docstring"""






								raise NotImplementedError()




							@abstractmethod
							def 				lowerCamelCase       ( self						):





								"""simple docstring"""






								raise NotImplementedError()

