


'''simple docstring'''


from __future__ import annotations

UpperCAmelCase_						:  Tuple				  =						[-10, -5, 0, 5, 5.1, 11, 13, 21, 3, 4, -21, -10, -5, -1, 0]
UpperCAmelCase_						:  Any				  =						[-5, 0, 5, 5.1, 11, 13, 21, -1, 4, -1, -10, -5, -1, 0, -1]







def      snake_case_  (    SCREAMING_SNAKE_CASE__	):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE					:			List[Any]							= []
				_SCREAMING_SNAKE_CASE					:			List[str]							= len(SCREAMING_SNAKE_CASE__	)

				for i in range(SCREAMING_SNAKE_CASE__	):
								_SCREAMING_SNAKE_CASE					:			float							= -1
								for j in range(i + 1				, SCREAMING_SNAKE_CASE__	):
												if arr[i] < arr[j]:
																_SCREAMING_SNAKE_CASE					:			Union[str, Any]							= arr[j]
																break
								result.append(SCREAMING_SNAKE_CASE__	)
				return result







def      snake_case_  (    SCREAMING_SNAKE_CASE__	):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE					:			List[Any]							= []
				for i, outer in enumerate(SCREAMING_SNAKE_CASE__	):
								_SCREAMING_SNAKE_CASE					:			float							= -1
								for inner in arr[i + 1 :]:
												if outer < inner:
																_SCREAMING_SNAKE_CASE					:			Any							= inner
																break
								result.append(SCREAMING_SNAKE_CASE__	)
				return result







def      snake_case_  (    SCREAMING_SNAKE_CASE__	):







				"""simple docstring"""





				_SCREAMING_SNAKE_CASE					:			Optional[Any]							= len(SCREAMING_SNAKE_CASE__	)
				_SCREAMING_SNAKE_CASE					:			list[float]							= []
				_SCREAMING_SNAKE_CASE					:			list[float]							= [-1] * arr_size

				for index in reversed(range(SCREAMING_SNAKE_CASE__	)	):
								if stack:
												while stack[-1] <= arr[index]:
																stack.pop()
																if not stack:
																				break
								if stack:
												_SCREAMING_SNAKE_CASE					:			int							= stack[-1]
								stack.append(arr[index]	)
				return result


if __name__ == "__main__":
				from doctest import testmod
				from timeit import timeit

				testmod()
				print(next_greatest_element_slow(arr))
				print(next_greatest_element_fast(arr))
				print(next_greatest_element(arr))

				UpperCAmelCase_						:  Optional[Any]				  =						(
				    'from __main__ import arr, next_greatest_element_slow, '
				    'next_greatest_element_fast, next_greatest_element'
				)
				print(
				    'next_greatest_element_slow():',
				    timeit('next_greatest_element_slow(arr)', setup=setup),
				)
				print(
				    'next_greatest_element_fast():',
				    timeit('next_greatest_element_fast(arr)', setup=setup),
				)
				print(
				    '     next_greatest_element():',
				    timeit('next_greatest_element(arr)', setup=setup),
				)








'''simple docstring'''


def      snake_case_  (    SCREAMING_SNAKE_CASE__	):







				"""simple docstring"""





				return "".join(chr(ord(SCREAMING_SNAKE_CASE__	) - 32	) if """a""" <= char <= """z""" else char for char in word	)


if __name__ == "__main__":
				from doctest import testmod

				testmod()




