'''simple docstring'''







from __future__ import annotations

UpperCamelCase_      	=	[-10, -5, 0, 5, 5.1, 11, 13, 21, 3, 4, -21, -10, -5, -1, 0]
UpperCamelCase_      	=	[-5, 0, 5, 5.1, 11, 13, 21, -1, 4, -1, -10, -5, -1, 0, -1]


def    lowerCamelCase       (			UpperCAmelCase__				:  list[float]		)			->	list[float]:


							'''simple docstring'''






							SCREAMING_SNAKE_CASE__     :int						    = []
							SCREAMING_SNAKE_CASE__     :str						    = len(__lowercase		)

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


def    lowerCamelCase       (			UpperCAmelCase__				:  list[float]		)			->	list[float]:


							'''simple docstring'''






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


def    lowerCamelCase       (			UpperCAmelCase__				:  list[float]		)			->	list[float]:


							'''simple docstring'''






							SCREAMING_SNAKE_CASE__     :str						    = len(__lowercase		)
							SCREAMING_SNAKE_CASE__     :Tuple						    = []
							SCREAMING_SNAKE_CASE__     :Any						    = [-1] * arr_size

							for index in reversed(range(__lowercase		)		):
														if stack:
																					while stack[-1] <= arr[index]:
																												stack.pop()
																												if not stack:
																																			break
														if stack:
																					SCREAMING_SNAKE_CASE__     :Optional[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_      	=	(
		    "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),
		)














def       _SCREAMING_SNAKE_CASE    (			__lowercase :      int     )    ->   list[int]:





    """simple docstring"""

    if length <= 0 or not isinstance(__lowercase      ,					__lowercase     ):
        raise ValueError("""Length must be a positive integer."""     )
    return [n * (2 * n - 1) for n in range(__lowercase     )]


if __name__ == "__main__":
  print(hexagonal_numbers(length=5))
  print(hexagonal_numbers(length=10))




