






'''simple docstring'''
def 	_a(					UpperCamelCase__			:  Tuple							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			Optional[Any]													=[0] * len(a_							)
      SCREAMING_SNAKE_CASE__       :			int													=[]
      SCREAMING_SNAKE_CASE__       :			Any													=[1] * len(a_							)

      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:
            SCREAMING_SNAKE_CASE__       :			Any													=queue.pop(0							)
            for x in graph[vertex]:
                  indegree[x] -= 1

                  if long_dist[vertex] + 1 > long_dist[x]:
                        SCREAMING_SNAKE_CASE__       :			Optional[int]													=long_dist[vertex] + 1

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

      print(max(a_							)							)


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







longest_distance(graph)







'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


a_					=	{
    'configuration_megatron_bert': ['MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegatronBertConfig'],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_					=	[
      'MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST',
      'MegatronBertForCausalLM',
      'MegatronBertForMaskedLM',
      'MegatronBertForMultipleChoice',
      'MegatronBertForNextSentencePrediction',
      'MegatronBertForPreTraining',
      'MegatronBertForQuestionAnswering',
      'MegatronBertForSequenceClassification',
      'MegatronBertForTokenClassification',
      'MegatronBertModel',
      'MegatronBertPreTrainedModel',
  ]

if TYPE_CHECKING:
  from .configuration_megatron_bert import MEGATRON_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, MegatronBertConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_megatron_bert import (
        MEGATRON_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        MegatronBertForCausalLM,
        MegatronBertForMaskedLM,
        MegatronBertForMultipleChoice,
        MegatronBertForNextSentencePrediction,
        MegatronBertForPreTraining,
        MegatronBertForQuestionAnswering,
        MegatronBertForSequenceClassification,
        MegatronBertForTokenClassification,
        MegatronBertModel,
        MegatronBertPreTrainedModel,
    )

else:
  import sys

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