from __future__ import annotations

from collections import deque





class 					A							:


   def __init__(self					:						List[Any]	,  __UpperCAmelCase					:						list[str]		)						->    List[Any]:
         """simple docstring"""



         UpperCAmelCase__								=  []
         self.adlist.append(
             {"value": "", "next_states": [], "fail_state": 0, "output": []}		)

         for keyword in keywords:
               self.add_keyword(__UpperCAmelCase		)
         self.set_fail_transitions()


   def       lowercase_				(self					:						List[str]	,  __UpperCAmelCase					:						int	,  __UpperCAmelCase					:						str		)						->    int | None:
         """simple docstring"""



         for state in self.adlist[current_state]["next_states"]:
               if char == self.adlist[state]["value"]:
                     return state
         return None


   def       lowercase_				(self					:						str	,  __UpperCAmelCase					:						str		)						->    None:
         """simple docstring"""



         UpperCAmelCase__								=  0
         for character in keyword:
               UpperCAmelCase__								=  self.find_next_state(__UpperCAmelCase	,  __UpperCAmelCase		)
               if next_state is None:
                     self.adlist.append(
                         {
                             "value": character,
                             "next_states": [],
                             "fail_state": 0,
                             "output": [],
                         }		)
                     self.adlist[current_state]["next_states"].append(len(self.adlist		) - 1		)
                     UpperCAmelCase__								=  len(self.adlist		) - 1
               else:
                     UpperCAmelCase__								=  next_state
         self.adlist[current_state]["output"].append(__UpperCAmelCase		)


   def       lowercase_				(self					:						Optional[Any]		)						->    None:
         """simple docstring"""



         UpperCAmelCase__								=  deque()
         for node in self.adlist[0]["next_states"]:
               q.append(__UpperCAmelCase		)
               UpperCAmelCase__								=  0
         while q:
               UpperCAmelCase__								=  q.popleft()
               for child in self.adlist[r]["next_states"]:
                     q.append(__UpperCAmelCase		)
                     UpperCAmelCase__								=  self.adlist[r]["fail_state"]
                     while (
                         self.find_next_state(__UpperCAmelCase	,  self.adlist[child]["value"]		) is None
                         and state != 0
                     ):
                           UpperCAmelCase__								=  self.adlist[state]["fail_state"]
                     UpperCAmelCase__								=  self.find_next_state(
                         __UpperCAmelCase	,  self.adlist[child]["value"]		)
                     if self.adlist[child]["fail_state"] is None:
                           UpperCAmelCase__								=  0
                     UpperCAmelCase__								=  (
                         self.adlist[child]["output"]
                         + self.adlist[self.adlist[child]["fail_state"]]["output"]
                     )





   def       lowercase_				(self					:						Tuple	,  __UpperCAmelCase					:						str		)						->    dict[str, list[int]]:
         """simple docstring"""



         UpperCAmelCase__								=  {}  # returns a dict with keywords and list of its occurrences
         UpperCAmelCase__								=  0
         for i in range(len(__UpperCAmelCase		)		):
               while (
                   self.find_next_state(__UpperCAmelCase	,  string[i]		) is None
                   and current_state != 0
               ):
                     UpperCAmelCase__								=  self.adlist[current_state]["fail_state"]
               UpperCAmelCase__								=  self.find_next_state(__UpperCAmelCase	,  string[i]		)
               if next_state is None:
                     UpperCAmelCase__								=  0
               else:
                     UpperCAmelCase__								=  next_state
                     for key in self.adlist[current_state]["output"]:
                           if key not in result:
                                 UpperCAmelCase__								=  []
                           result[key].append(i - len(__UpperCAmelCase		) + 1		)
         return result


if __name__ == "__main__":
      import doctest

      doctest.testmod()




from __future__ import annotations




def        lowerCAmelCase_			(					__A							)					->    list[int]:







      '''simple docstring'''


      if len(__A							) == 0:
            return array

      UpperCAmelCase__		,				UpperCAmelCase__								=  min(__A							), max(__A							)

      # Compute the variables
      UpperCAmelCase__								=  _max - _min + 1
      UpperCAmelCase__		,				UpperCAmelCase__								=  [0] * holes_range, [0] * holes_range

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

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

    # Returns the sorted array.
      return array


if __name__ == "__main__":
      import doctest

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



