'''simple docstring'''





from __future__ import annotations





def 	lowerCAmelCase_				(					snake_case_       : list[int]					,    snake_case_       : int					,    snake_case_       : int					,    snake_case_       : int			)    ->      None:


     '''simple docstring'''




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





def 	lowerCAmelCase_				(					snake_case_       : list[int]					,    snake_case_       : int					,    snake_case_       : int					,    snake_case_       : int			)    ->      None:


     '''simple docstring'''




     if length > 1:
          UpperCAmelCase_           =   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 	lowerCAmelCase_				(					snake_case_       : list[int]					,    snake_case_       : int					,    snake_case_       : int					,    snake_case_       : int			)    ->      None:


     '''simple docstring'''




     if length > 1:
          UpperCAmelCase_           =   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__":
    SCREAMING_SNAKE_CASE_:     Dict  =input('Enter numbers separated by a comma:\n').strip()
    SCREAMING_SNAKE_CASE_:     Union[str, Any]  =[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=', ')





'''simple docstring'''





def 	lowerCAmelCase_				(					snake_case_       : int					,    snake_case_       : int			)    ->      str:


     '''simple docstring'''




     if a < 0 or b < 0:
          raise ValueError("the value of both inputs must be positive"			)
     UpperCAmelCase_           =   str(bin(snake_case_			)			)[2:]  # remove the leading "0b"
     UpperCAmelCase_           =   str(bin(snake_case_			)			)[2:]
     UpperCAmelCase_           =   max(len(snake_case_			)					,    len(snake_case_			)			)
     return "0b" + "".join(
         str(int("1" in (char_a, char_b)			)			)
         for char_a, char_b in zip(a_binary.zfill(snake_case_			)					,    b_binary.zfill(snake_case_			)			)			)


if __name__ == "__main__":
    import doctest

    doctest.testmod()




