





from __future__ import annotations




def _a (  SCREAMING_SNAKE_CASE__      :  list[int]			,				SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int       )	->    None:

       '''simple docstring'''






       if (direction == 1 and array[indexa] > array[indexa]) or (
           direction == 0 and array[indexa] < array[indexa]
       ):
              SCREAMING_SNAKE_CASE__       :      Optional[Any]     =						array[indexa], array[indexa]




def _a (  SCREAMING_SNAKE_CASE__      :  list[int]			,				SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int       )	->    None:

       '''simple docstring'''






       if length > 1:
              SCREAMING_SNAKE_CASE__       :      Optional[Any]     =						int(length / 2       )
              for i in range(SCREAMING_SNAKE_CASE__			,				low + middle       ):
                     comp_and_swap(SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				i + middle			,				SCREAMING_SNAKE_CASE__       )
              bitonic_merge(SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__       )
              bitonic_merge(SCREAMING_SNAKE_CASE__			,				low + middle			,				SCREAMING_SNAKE_CASE__			,				SCREAMING_SNAKE_CASE__       )




def _a (  SCREAMING_SNAKE_CASE__      :  list[int]			,				SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int			,				SCREAMING_SNAKE_CASE__      :  int       )	->    None:

       '''simple docstring'''






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


if __name__ == "__main__":
  _lowerCamelCase :    int  							= input('''Enter numbers separated by a comma:\n''').strip()
  _lowerCamelCase :    Optional[int]  							= [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 _a (  SCREAMING_SNAKE_CASE__      :  str       )	->    str:

							'''simple docstring'''






							if not all(char in "01" for char in bin_string       ):
														raise ValueError("Non-binary value was passed to the function"       )
							if not bin_string:
														raise ValueError("Empty string was passed to the function"       )
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						""
							while len(SCREAMING_SNAKE_CASE__       ) % 3 != 0:
														SCREAMING_SNAKE_CASE__       :      str     =						"0" + bin_string
							SCREAMING_SNAKE_CASE__       :      List[Any]     =						[
							    bin_string[index : index + 3]
							    for index in range(len(SCREAMING_SNAKE_CASE__       )       )
							    if index % 3 == 0
							]
							for bin_group in bin_string_in_3_list:
														SCREAMING_SNAKE_CASE__       :      List[Any]     =						0
														for index, val in enumerate(SCREAMING_SNAKE_CASE__       ):
																					oct_val += int(2 ** (2 - index) * int(SCREAMING_SNAKE_CASE__       )       )
														oct_string += str(SCREAMING_SNAKE_CASE__       )
							return oct_string


if __name__ == "__main__":
		from doctest import testmod

		testmod()






