


from random import randint, random


def      a	(							SCREAMING_SNAKE_CASE_      :		int							,			SCREAMING_SNAKE_CASE_      :		int							,			SCREAMING_SNAKE_CASE_      :		int							,			SCREAMING_SNAKE_CASE_      :		bool = False							,			SCREAMING_SNAKE_CASE_      :		bool = False							,			SCREAMING_SNAKE_CASE_      :		int = 5							,			):






       """simple docstring"""





       UpperCamelCase    :	List[Any]   	=		[[-1] * number_of_cells]  # Create a highway without any car
       UpperCamelCase    :	List[Any]   	=		0
       UpperCamelCase    :	Optional[int]   	=		max(SCREAMING_SNAKE_CASE_							,			0       )
       while i < number_of_cells:
              UpperCamelCase    :	str   	=		(
                  randint(0							,			SCREAMING_SNAKE_CASE_       ) if random_speed else initial_speed
              )  # Place the cars
              i += (
                  randint(1							,			max_speed * 2       ) if random_frequency else frequency
              )  # Arbitrary number, may need tuning
       return highway


def      a	(							SCREAMING_SNAKE_CASE_      :		list							,			SCREAMING_SNAKE_CASE_      :		int       ):






       """simple docstring"""





       UpperCamelCase    :	Dict   	=		0
       UpperCamelCase    :	Union[str, Any]   	=		highway_now[car_index + 1 :]
       for cell in range(len(SCREAMING_SNAKE_CASE_       )       ):  # May need a better name for this
              if cells[cell] != -1:  # If the cell is not empty then
                     return distance  # we have the distance we wanted
              distance += 1
       # Here if the car is near the end of the highway
       return distance + get_distance(SCREAMING_SNAKE_CASE_							,			-1       )


def      a	(							SCREAMING_SNAKE_CASE_      :		list							,			SCREAMING_SNAKE_CASE_      :		float							,			SCREAMING_SNAKE_CASE_      :		int       ):






       """simple docstring"""





       UpperCamelCase    :	Optional[int]   	=		len(SCREAMING_SNAKE_CASE_       )
       # Beforce calculations, the highway is empty
       UpperCamelCase    :	Optional[Any]   	=		[-1] * number_of_cells

       for car_index in range(SCREAMING_SNAKE_CASE_       ):
              if highway_now[car_index] != -1:
                     # Add 1 to the current speed of the car and cap the speed
                     UpperCamelCase    :	Dict   	=		min(highway_now[car_index] + 1							,			SCREAMING_SNAKE_CASE_       )
                     # Number of empty cell before the next car
                     UpperCamelCase    :	str   	=		get_distance(SCREAMING_SNAKE_CASE_							,			SCREAMING_SNAKE_CASE_       ) - 1
                     # We can't have the car causing an accident
                     UpperCamelCase    :	int   	=		min(next_highway[car_index]							,			SCREAMING_SNAKE_CASE_       )
                     if random() < probability:
                            # Randomly, a driver will slow down
                            UpperCamelCase    :	Union[str, Any]   	=		max(next_highway[car_index] - 1							,			0       )
       return next_highway


def      a	(							SCREAMING_SNAKE_CASE_      :		list							,			SCREAMING_SNAKE_CASE_      :		int							,			SCREAMING_SNAKE_CASE_      :		float							,			SCREAMING_SNAKE_CASE_      :		int       ):






       """simple docstring"""





       UpperCamelCase    :	Any   	=		len(highway[0]       )

       for i in range(SCREAMING_SNAKE_CASE_       ):
              UpperCamelCase    :	Optional[Any]   	=		update(highway[i]							,			SCREAMING_SNAKE_CASE_							,			SCREAMING_SNAKE_CASE_       )
              UpperCamelCase    :	str   	=		[-1] * number_of_cells

              for car_index in range(SCREAMING_SNAKE_CASE_       ):
                     UpperCamelCase    :	Dict   	=		next_speeds_calculated[car_index]
                     if speed != -1:
                            # Change the position based on the speed (with % to create the loop)
                            UpperCamelCase    :	int   	=		(car_index + speed) % number_of_cells
                            # Commit the change of position
                            UpperCamelCase    :	Union[str, Any]   	=		speed
              highway.append(SCREAMING_SNAKE_CASE_       )

       return highway


if __name__ == "__main__":
  import doctest

  doctest.testmod()





from __future__ import annotations


def      a	(							SCREAMING_SNAKE_CASE_      :		list[int]       ):






       """simple docstring"""





       if len(SCREAMING_SNAKE_CASE_       ) == 0:
              return array

       UpperCamelCase	, UpperCamelCase    :	Union[str, Any]   	=		min(SCREAMING_SNAKE_CASE_       ), max(SCREAMING_SNAKE_CASE_       )

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

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

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

    # Returns the sorted array.
       return array


if __name__ == "__main__":
  import doctest

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

