
"""simple docstring"""






def  __lowerCamelCase					(					lowerCAmelCase__				):
				stooge(SCREAMING_SNAKE_CASE_       ,0       ,len(SCREAMING_SNAKE_CASE_				) - 1				)
				return arr



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__       ,lowerCAmelCase__				):
				if i >= h:
								return

				# If first element is smaller than the last then swap them
				if arr[i] > arr[h]:
								A__ ,			A__							 =       arr[h], arr[i]

				# If there are more than 2 elements in the array
				if h - i + 1 > 2:
								A__							 =       (int)((h - i + 1) / 3				)

								# Recursively sort first 2/3 elements
								stooge(SCREAMING_SNAKE_CASE_       ,SCREAMING_SNAKE_CASE_       ,(h - t)				)

								# Recursively sort last 2/3 elements
								stooge(SCREAMING_SNAKE_CASE_       ,i + t       ,(SCREAMING_SNAKE_CASE_)				)

								# Recursively sort first 2/3 elements
								stooge(SCREAMING_SNAKE_CASE_       ,SCREAMING_SNAKE_CASE_       ,(h - t)				)


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE						:						Tuple					   =       input('''Enter numbers separated by a comma:\n''').strip()
					SCREAMING_SNAKE_CASE						:						str					   =       [int(item) for item in user_input.split(''',''')]
					print(stooge_sort(unsorted))










"""simple docstring"""






from PIL import Image



def  __lowerCamelCase					(					lowerCAmelCase__				):
				A__ ,			A__							 =       image.size
				A__							 =       0
				A__							 =       image.load()
				for i in range(lowerCAmelCase__				):
								for j in range(lowerCAmelCase__				):
												A__							 =       pixels[j, i]
												mean += pixel
				mean //= width * height

				for j in range(lowerCAmelCase__				):
								for i in range(lowerCAmelCase__				):
												A__							 =       255 if pixels[i, j] > mean else 0
				return image


if __name__ == "__main__":
					SCREAMING_SNAKE_CASE						:						Dict					   =       mean_threshold(Image.open('''path_to_image''').convert('''L'''))
					image.save('''output_image_path''')


