


from __future__ import annotations






def 							_lowerCAmelCase (  _a   :					list[int]			)	->			list[int]:
     if len(_a			) == 0:
          return array

     lowerCAmelCase_					:       Optional[int]    =		min(_a			), max(_a			)

     # Compute the variables
     lowerCAmelCase_					:       Union[str, Any]    =		_max - _min + 1
     lowerCAmelCase_					:       Any    =		[0] * holes_range, [0] * holes_range

     # Make the sorting.
     for i in array:
          lowerCAmelCase_					:       List[Any]    =		i - _min
          lowerCAmelCase_					:       List[Any]    =		i
          holes_repeat[index] += 1

     # Makes the array back by replacing the numbers.
     lowerCAmelCase_					:       int    =		0
     for i in range(_a			):
          while holes_repeat[i] > 0:
               lowerCAmelCase_					:       Any    =		holes[i]
               index += 1
               holes_repeat[i] -= 1

    # Returns the sorted array.
     return array


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      UpperCAmelCase_					:   str 							=						input("""Enter numbers separated by comma:\n""")
      UpperCAmelCase_					:   Union[str, Any] 							=						[int(x) for x in user_input.split(""",""")]
      print(pigeon_sort(unsorted))







from __future__ import annotations






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

     lowerCAmelCase_					:       Tuple    =		[element for element in array[1:] if element >= pivot]
     lowerCAmelCase_					:       List[Any]    =		[pivot, *longest_subsequence(_a			)]
     if len(_a			) > len(_a			):
          return temp_array
     else:
          return longest_subseq


if __name__ == "__main__":
      import doctest

      doctest.testmod()
