
class  lowercase__:  # Public class to implement a graph



	"""simple docstring"""




	def __init__(       self  :			Dict       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			list[list[bool]]       )       ->     None:
					lowercase_       =					row
					lowercase_       =					col
					lowercase_       =					graph
	def 						_lowercase  (       self  :			str       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			list[list[bool]]       )       ->     bool:
					return (
					    0 <= i < self.ROW
					    and 0 <= j < self.COL
					    and not visited[i][j]
					    and self.graph[i][j]
					)
	def 						_lowercase  (       self  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			int       ,							SCREAMING_SNAKE_CASE_  :			list[list[bool]]       )       ->     None:
					# Checking all 8 elements surrounding nth element
					lowercase_       =					[-1, -1, -1, 0, 0, 1, 1, 1]  # Coordinate order
					lowercase_       =					[-1, 0, 1, -1, 1, -1, 0, 1]
					lowercase_       =					True  # Make those cells visited
					for k in range(8       ):
									if self.is_safe(i + row_nbr[k]       ,							j + col_nbr[k]       ,							SCREAMING_SNAKE_CASE_       ):
													self.diffs(i + row_nbr[k]       ,							j + col_nbr[k]       ,							SCREAMING_SNAKE_CASE_       )




	def 						_lowercase  (       self  :			Tuple       )       ->     int:  # And finally, count all islands.
					lowercase_       =					[[False for j in range(self.COL       )] for i in range(self.ROW       )]
					lowercase_       =					0
					for i in range(self.ROW       ):
									for j in range(self.COL       ):
													if visited[i][j] is False and self.graph[i][j] == 1:
																	self.diffs(SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_       ,							SCREAMING_SNAKE_CASE_       )
																	count += 1
					return count






from __future__ import annotations




def 				a						(							snake_case__:					list[int]						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int					):


				'''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 				a						(							snake_case__:					list[int]						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int					):


				'''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 				a						(							snake_case__:					list[int]						,   snake_case__:					int						,   snake_case__:					int						,   snake_case__:					int					):


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




