

import math


class SCREAMING_SNAKE_CASE	:






			"""simple docstring"""




			def __init__(     self			,					__UpperCamelCase=0				):  # a graph with Node 0,1,...,N-1

				"""simple docstring"""


				snake_case_   		=			n
				snake_case_   		=			[
				    [math.inf for j in range(0			,					__UpperCamelCase				)] for i in range(0			,					__UpperCamelCase				)
				]  # adjacency matrix for weight
				snake_case_   		=			[
				    [math.inf for j in range(0			,					__UpperCamelCase				)] for i in range(0			,					__UpperCamelCase				)
				]  # dp[i][j] stores minimum distance from i to j


			def       __lowerCAmelCase			(     self			,					__UpperCamelCase			,					__UpperCamelCase			,					__UpperCamelCase				):

				"""simple docstring"""


				snake_case_   		=			w


			def       __lowerCAmelCase			(     self				):

				"""simple docstring"""


				for k in range(0			,					self.n				):
					for i in range(0			,					self.n				):
						for j in range(0			,					self.n				):
							snake_case_   		=			min(self.dp[i][j]			,					self.dp[i][k] + self.dp[k][j]				)







			def       __lowerCAmelCase			(     self			,					__UpperCamelCase			,					__UpperCamelCase				):

				"""simple docstring"""


				return self.dp[u][v]


if __name__ == "__main__":
		A									=  Graph(5)
		graph.add_edge(0, 2, 9)
		graph.add_edge(0, 4, 10)
		graph.add_edge(1, 3, 5)
		graph.add_edge(2, 3, 7)
		graph.add_edge(3, 0, 10)
		graph.add_edge(3, 1, 2)
		graph.add_edge(3, 2, 1)
		graph.add_edge(3, 4, 6)
		graph.add_edge(4, 1, 3)
		graph.add_edge(4, 2, 4)
		graph.add_edge(4, 3, 9)
		graph.floyd_warshall()
		graph.show_min(1, 4)
		graph.show_min(0, 3)



from __future__ import annotations





def a(lowercase__      ,			lowercase__      ,			lowercase__      ,			lowercase__						):





	'''simple docstring'''
	if (direction == 1 and array[indexa] > array[indexa]) or (
	    direction == 0 and array[indexa] < array[indexa]
	):
		snake_case_		,							snake_case_   		=			array[indexa], array[indexa]





def a(lowercase__      ,			lowercase__      ,			lowercase__      ,			lowercase__						):





	'''simple docstring'''
	if length > 1:
		snake_case_   		=			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 a(lowercase__      ,			lowercase__      ,			lowercase__      ,			lowercase__						):





	'''simple docstring'''
	if length > 1:
		snake_case_   		=			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__":
		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=', ')
