



def 						UpperCamelCase      (  snake_case__			:       Optional[int]      )      ->	str:
   UpperCamelCase       :    List[str]		      =      [0] * len(snake_case__      )
   UpperCamelCase       :    int		      =      []
   UpperCamelCase       :    Optional[int]		      =      [1] * len(snake_case__      )

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

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

   while queue:
      UpperCamelCase       :    Optional[int]		      =      queue.pop(0      )
      for x in graph[vertex]:
         indegree[x] -= 1

         if long_dist[vertex] + 1 > long_dist[x]:
            UpperCamelCase       :    Tuple		      =      long_dist[vertex] + 1

         if indegree[x] == 0:
            queue.append(snake_case__      )

   print(max(snake_case__      )      )


# Adjacency list of Graph
__UpperCAmelCase			  =			{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}


longest_distance(graph)






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a_      =     {
    'configuration_swinv2': ['SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP', 'Swinv2Config'],
}


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			a_      =     [
			    'SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'Swinv2ForImageClassification',
			    'Swinv2ForMaskedImageModeling',
			    'Swinv2Model',
			    'Swinv2PreTrainedModel',
			]


if TYPE_CHECKING:
			from .configuration_swinva import SWINV2_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinvaConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_swinva import (
						    SWINV2_PRETRAINED_MODEL_ARCHIVE_LIST,
						    SwinvaForImageClassification,
						    SwinvaForMaskedImageModeling,
						    SwinvaModel,
						    SwinvaPreTrainedModel,
						)


else:
			import sys

			a_      =     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)