


from __future__ import annotations

snake_case							: Optional[Any]      =   10






def 							__lowercase     (				__lowerCAmelCase							:       Any     ):
							a__    =  1
							a__    =  max(__lowerCAmelCase     )
							while placement <= max_digit:
														# declare and initialize empty buckets
														a__    =  [[] for _ in range(__lowerCAmelCase     )]
														# split list_of_ints between the buckets
														for i in list_of_ints:
																					a__    =  int((i / placement) % RADIX     )
																					buckets[tmp].append(__lowerCAmelCase     )
														# put each buckets' contents into list_of_ints
														a__    =  0
														for b in range(__lowerCAmelCase     ):
																					for i in buckets[b]:
																												a__    =  i
																												a += 1
        # move to next
														placement *= RADIX
							return list_of_ints


if __name__ == "__main__":
						import doctest

						doctest.testmod()








from __future__ import annotations






def 							__lowercase     (				__lowerCAmelCase							:       list[int]     ):  # This function is recursive
							a__    =  len(__lowerCAmelCase     )
							# If the array contains only one element, we return it (it's the stop condition of
							# recursion)
							if array_length <= 1:
														return array
														# Else
							a__    =  array[0]
							a__    =  False
							a__    =  1
							a__    =  []
							while not is_found and i < array_length:
														if array[i] < pivot:
																					a__    =  True
																					a__    =  [element for element in array[i:] if element >= array[i]]
																					a__    =  longest_subsequence(__lowerCAmelCase     )
																					if len(__lowerCAmelCase     ) > len(__lowerCAmelCase     ):
																												a__    =  temp_array
														else:
																					i += 1

							a__    =  [element for element in array[1:] if element >= pivot]
							a__    =  [pivot, *longest_subsequence(__lowerCAmelCase     )]
							if len(__lowerCAmelCase     ) > len(__lowerCAmelCase     ):
														return temp_array
							else:
														return longest_subseq


if __name__ == "__main__":
						import doctest

						doctest.testmod()




