





from __future__ import annotations

class    _UpperCAmelCase							:
      def __init__(		self      ,       a__       ):
         A_     :				Optional[int]			      =	order

         # a_{0} ... a_{k}
         A_     :				Union[str, Any]			      =	[1.0] + [0.0] * order
         # b_{0} ... b_{k}
         A_     :				List[Any]			      =	[1.0] + [0.0] * order

         # x[n-1] ... x[n-k]
         A_     :				Any			      =	[0.0] * self.order
         # y[n-1] ... y[n-k]
         A_     :				str			      =	[0.0] * self.order
      def 		_lowerCamelCase      (		self      ,       a__      ,       a__       ):
         if len(a__       ) < self.order:
            A_     :				Dict			      =	[1.0, *a_coeffs]

         if len(a__       ) != self.order + 1:
            A_     :				List[Any]			      =	(
                F"""Expected a_coeffs to have {self.order + 1} elements """
                F"""for {self.order}-order filter, got {len(a__       )}"""
            )
            raise ValueError(a__       )

         if len(a__       ) != self.order + 1:
            A_     :				Union[str, Any]			      =	(
                F"""Expected b_coeffs to have {self.order + 1} elements """
                F"""for {self.order}-order filter, got {len(a__       )}"""
            )
            raise ValueError(a__       )

         A_     :				Union[str, Any]			      =	a_coeffs
         A_     :				List[Any]			      =	b_coeffs






      def 		_lowerCamelCase      (		self      ,       a__       ):
         A_     :				List[Any]			      =	0.0

         # Start at index 1 and do index 0 at the end.
         for i in range(1      ,       self.order + 1       ):
            result += (
                self.b_coeffs[i] * self.input_history[i - 1]
                - self.a_coeffs[i] * self.output_history[i - 1]
            )

         A_     :				Dict			      =	(result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

         A_     :				int			      =	self.input_history[:-1]
         A_     :				str			      =	self.output_history[:-1]

         A_     :				Any			      =	sample
         A_     :				Tuple			      =	result

         return result













def     _lowerCAmelCase		(  _lowerCAmelCase     ):
   '''simple docstring'''


   A_     :				Union[str, Any]			      =	[0] * len(_lowerCAmelCase     )
   A_     :				Optional[int]			      =	[]
   A_     :				str			      =	[]
   A_     :				Dict			      =	0

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

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

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

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


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







topological_sort(graph)






