
'''simple docstring'''


class 	__lowercase				:

			def __init__(self			,   A      ):
								lowerCamelCase_					:      Optional[Any]     =		size
								lowerCamelCase_					:      int     =		[0] * size
								lowerCamelCase_					:      str     =		[0] * size

			@staticmethod
			def        UpperCAmelCase__ (A      ):
								return index | (index + 1)

			@staticmethod
			def        UpperCAmelCase__ (A      ):
								return (index & (index + 1)) - 1

			def        UpperCAmelCase__ (self			,   A			,   A      ):
								lowerCamelCase_					:      Dict     =		value
								while index < self.size:
													lowerCamelCase_					:      Any     =		self.get_prev(A      ) + 1
													if current_left_border == index:
																		lowerCamelCase_					:      Optional[int]     =		value
													else:
																		lowerCamelCase_					:      int     =		max(A			,   A			,   A      )
													lowerCamelCase_					:      List[Any]     =		self.get_next(A      )






			def        UpperCAmelCase__ (self			,   A			,   A      ):
								right -= 1  # Because of right is exclusive
								lowerCamelCase_					:      List[Any]     =		0
								while left <= right:
													lowerCamelCase_					:      List[Any]     =		self.get_prev(A      )
													if left <= current_left:
																		lowerCamelCase_					:      Tuple     =		max(A			,   self.tree[right]      )
																		lowerCamelCase_					:      Dict     =		current_left
													else:
																		lowerCamelCase_					:      int     =		max(A			,   self.arr[right]      )
																		right -= 1
								return result


if __name__ == "__main__":
					import doctest

					doctest.testmod()




'''simple docstring'''


from __future__ import annotations




def lowercase_	(   _lowercase			,       _lowercase			,       _lowercase			,       _lowercase				)     ->							None:
					'''simple docstring'''

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




def lowercase_	(   _lowercase			,       _lowercase			,       _lowercase			,       _lowercase				)     ->							None:
					'''simple docstring'''

					if length > 1:
										lowerCamelCase_					:      int     =		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 lowercase_	(   _lowercase			,       _lowercase			,       _lowercase			,       _lowercase				)     ->							None:
					'''simple docstring'''

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


