





'''simple docstring'''




from __future__ import annotations






def 	_lowerCAmelCase      (  __snake_case  :			list			,							__snake_case  :			int			,							__snake_case  :			int			,							__snake_case  :			int      )					->					List[str]:
     __A						:			str								=	[]
     __A						:			List[str]								=	input_list[low:mid], input_list[mid : high + 1]
     while left and right:
          result.append((left if left[0] <= right[0] else right).pop(0      )      )
     __A						:			List[Any]								=	result + left + right
     return input_list






def 	_lowerCAmelCase      (  __snake_case  :			list      )					->					Union[str, Any]:
     if len(__SCREAMING_SNAKE_CASE      ) <= 1:
          return input_list
     __A						:			Union[str, Any]								=	list(__SCREAMING_SNAKE_CASE      )

     # iteration for two-way merging
     __A						:			Tuple								=	2
     while p <= len(__SCREAMING_SNAKE_CASE      ):
          # getting low, high and middle value for merge-sort of single list
          for i in range(0			,							len(__SCREAMING_SNAKE_CASE      )			,							__SCREAMING_SNAKE_CASE      ):
               __A						:			List[str]								=	i
               __A						:			str								=	i + p - 1
               __A						:			Optional[Any]								=	(low + high + 1) // 2
               __A						:			str								=	merge(__SCREAMING_SNAKE_CASE			,							__SCREAMING_SNAKE_CASE			,							__SCREAMING_SNAKE_CASE			,							__SCREAMING_SNAKE_CASE      )
          # final merge of last two parts
          if p * 2 >= len(__SCREAMING_SNAKE_CASE      ):
               __A						:			List[str]								=	i
               __A						:			str								=	merge(__SCREAMING_SNAKE_CASE			,							0			,							__SCREAMING_SNAKE_CASE			,							len(__SCREAMING_SNAKE_CASE      ) - 1      )
               break
          p *= 2

     return input_list


if __name__ == "__main__":
  lowercase__   :				List[str]      =   input('''Enter numbers separated by a comma:\n''').strip()
  if user_input == "":
    lowercase__   :				List[Any]      =   []
  else:
    lowercase__   :				Dict      =   [int(item.strip()) for item in user_input.split(''',''')]
  print(iter_merge_sort(unsorted))






'''simple docstring'''




def 	_lowerCAmelCase      (  __snake_case  :			str      )					->					str:
     __A						:			Optional[Any]								=	[0] * len(__snake_case      )
     __A						:			Dict								=	[]
     __A						:			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:
          __A						:			int								=	queue.pop(0      )
          for x in graph[vertex]:
               indegree[x] -= 1

               if long_dist[vertex] + 1 > long_dist[x]:
                    __A						:			str								=	long_dist[vertex] + 1

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

     print(max(__snake_case      )      )


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







longest_distance(graph)