


from __future__ import annotations
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)     ->			None:







 """simple docstring"""


 if (direction == 1 and array[indexa] > array[indexa]) or (
     direction == 0 and array[indexa] < array[indexa]
 ):
  _lowercase      ,    _lowercase							      =array[indexa], array[indexa]
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)     ->			None:







 """simple docstring"""


 if length > 1:
  _lowercase							      =int(length / 2						)
  for i in range(__snake_case     ,						low + middle						):
   comp_and_swap(__snake_case     ,						__snake_case     ,						i + middle     ,						__snake_case						)
  bitonic_merge(__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)
  bitonic_merge(__snake_case     ,						low + middle     ,						__snake_case     ,						__snake_case						)
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)     ->			None:







 """simple docstring"""


 if length > 1:
  _lowercase							      =int(length / 2						)
  bitonic_sort(__snake_case     ,						__snake_case     ,						__snake_case     ,						1						)
  bitonic_sort(__snake_case     ,						low + middle     ,						__snake_case     ,						0						)
  bitonic_merge(__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)


if __name__ == "__main__":
  UpperCAmelCase__   	=							input('''Enter numbers separated by a comma:\n''').strip()
  UpperCAmelCase__   	=							[int(item.strip()) for item in user_input.split(''',''')]

  bitonic_sort(unsorted, 0, len(unsorted), 1)
  print('''\nSorted array in ascending order is: ''', end='''''')
  print(*unsorted, sep=''', ''')

  bitonic_merge(unsorted, 0, len(unsorted), 0)
  print('''Sorted array in descending order is: ''', end='''''')
  print(*unsorted, sep=''', ''')







def SCREAMING_SNAKE_CASE				(       lowercase_						)   ->       Any:



       """simple docstring"""

       A__       =    [0] * len(lowercase_						)
       A__       =    []
       A__       =    [1] * len(lowercase_						)

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

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

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

                     if long_dist[vertex] + 1 > long_dist[x]:
                            A__       =    long_dist[vertex] + 1

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

       print(max(lowercase_						)						)


# Adjacency list of Graph
_lowerCamelCase	:		Optional[int]							       =   {0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}
longest_distance(graph)


