



'''simple docstring'''






import os
from distutils.util import strtobool






def  UpperCamelCase__					(					_lowercase    :				str   ,    _lowercase    :				Optional[int]     )							->	Union[str, Any]:



  for e in env_keys:
    __UpperCAmelCase:					List[str]		= int(os.environ.get(lowerCAmelCase_   ,    -1     )     )
    if val >= 0:
      return val
  return default






def  UpperCamelCase__					(					_lowercase    :				Tuple   ,    _lowercase    :				Union[str, Any]=False     )							->	Dict:
  __UpperCAmelCase:					List[Any]		= os.environ.get(lowerCAmelCase_   ,    str(lowerCAmelCase_     )     )
  return strtobool(lowerCAmelCase_     ) == 1  # As its name indicates `strtobool` actually returns an int...







def  UpperCamelCase__					(					_lowercase    :				List[str]   ,    _lowercase    :				Optional[int]="no"     )							->	Tuple:
  __UpperCAmelCase:					List[str]		= os.environ.get(lowerCAmelCase_   ,    str(lowerCAmelCase_     )     )
  return value
'''simple docstring'''






from __future__ import annotations






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if (direction == 1 and array[indexa] > array[indexa]) or (
      direction == 0 and array[indexa] < array[indexa]
  ):
    __UpperCAmelCase, __UpperCAmelCase:					str		= array[indexa], array[indexa]






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if length > 1:
    __UpperCAmelCase:					List[str]		= int(length / 2     )
    for i in range(_lowercase   ,    low + middle     ):
      comp_and_swap(_lowercase   ,    _lowercase   ,    i + middle   ,    _lowercase     )
    bitonic_merge(_lowercase   ,    _lowercase   ,    _lowercase   ,    _lowercase     )
    bitonic_merge(_lowercase   ,    low + middle   ,    _lowercase   ,    _lowercase     )






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if length > 1:
    __UpperCAmelCase:					Any		= int(length / 2     )
    bitonic_sort(_lowercase   ,    _lowercase   ,    _lowercase   ,    1     )
    bitonic_sort(_lowercase   ,    low + middle   ,    _lowercase   ,    0     )
    bitonic_merge(_lowercase   ,    _lowercase   ,    _lowercase   ,    _lowercase     )


if __name__ == "__main__":
    SCREAMING_SNAKE_CASE_	   =			input('Enter numbers separated by a comma:\n').strip()
    SCREAMING_SNAKE_CASE_	   =			[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=', ')