






"""simple docstring"""
lowerCAmelCase__    						=			256
# Modulus to hash a string
lowerCAmelCase__    						=			1_000_003





def 				lowercase__		(					lowerCamelCase,						lowerCamelCase       ):
				_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    len(_snake_case       )
				_SCREAMING_SNAKE_CASE   :		List[Any]       		=    len(_snake_case       )
				if p_len > t_len:
								return False

				_SCREAMING_SNAKE_CASE   :		Tuple       		=    0
				_SCREAMING_SNAKE_CASE   :		Optional[int]       		=    0
				_SCREAMING_SNAKE_CASE   :		Tuple       		=    1

				# Calculating the hash of pattern and substring of text
				for i in range(_snake_case       ):
								_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    (ord(pattern[i]       ) + p_hash * alphabet_size) % modulus
								_SCREAMING_SNAKE_CASE   :		int       		=    (ord(text[i]       ) + text_hash * alphabet_size) % modulus
								if i == p_len - 1:
												continue
								_SCREAMING_SNAKE_CASE   :		Dict       		=    (modulus_power * alphabet_size) % modulus

				for i in range(0,						t_len - p_len + 1       ):
								if text_hash == p_hash and text[i : i + p_len] == pattern:
												return True
								if i == t_len - p_len:
												continue
								# Calculate the https://en.wikipedia.org/wiki/Rolling_hash
								_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    (
								    (text_hash - ord(text[i]       ) * modulus_power) * alphabet_size
								    + ord(text[i + p_len]       )
								) % modulus
				return False





def 				lowercase__		(					):
				_SCREAMING_SNAKE_CASE   :		str       		=    'abc1abc12'
				_SCREAMING_SNAKE_CASE   :		Any       		=    'alskfjaldsabc1abc1abc12k23adsfabcabc'
				_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    'alskfjaldsk23adsfabcabc'
				assert rabin_karp(_snake_case,						_snake_case       ) and not rabin_karp(_snake_case,						_snake_case       )

				# Test 2)
				_SCREAMING_SNAKE_CASE   :		str       		=    'ABABX'
				_SCREAMING_SNAKE_CASE   :		List[str]       		=    'ABABZABABYABABX'
				assert rabin_karp(_snake_case,						_snake_case       )

				# Test 3)
				_SCREAMING_SNAKE_CASE   :		Optional[Any]       		=    'AAAB'
				_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    'ABAAAAAB'
				assert rabin_karp(_snake_case,						_snake_case       )

				# Test 4)
				_SCREAMING_SNAKE_CASE   :		Dict       		=    'abcdabcy'
				_SCREAMING_SNAKE_CASE   :		Tuple       		=    'abcxabcdabxabcdabcdabcy'
				assert rabin_karp(_snake_case,						_snake_case       )

				# Test 5)
				_SCREAMING_SNAKE_CASE   :		str       		=    'Lü'
				_SCREAMING_SNAKE_CASE   :		Dict       		=    'Lüsai'
				assert rabin_karp(_snake_case,						_snake_case       )
				_SCREAMING_SNAKE_CASE   :		Any       		=    'Lue'
				assert not rabin_karp(_snake_case,						_snake_case       )
				print('Success.'       )


if __name__ == "__main__":
			test_rabin_karp()






UpperCAmelCase_		 =					0  # The first color of the flag.
UpperCAmelCase_		 =					1  # The second color of the flag.
UpperCAmelCase_		 =					2  # The third color of the flag.
UpperCAmelCase_		 =					(red, white, blue)

def 	SCREAMING_SNAKE_CASE_							(	_snake_case	:list				)  ->     list:
   if not sequence:
      return []
   if len(_snake_case				) == 1:
      return list(_snake_case				)
   _A      =       0
   _A      =       len(_snake_case				) - 1
   _A      =       0
   while mid <= high:
      if sequence[mid] == colors[0]:
         _A  ,    _A      =       sequence[mid], sequence[low]
         low += 1
         mid += 1
      elif sequence[mid] == colors[1]:
         mid += 1
      elif sequence[mid] == colors[2]:
         _A  ,    _A      =       sequence[high], sequence[mid]
         high -= 1
      else:
         _A      =       F'''The elements inside the sequence must contains only {colors} values'''
         raise ValueError(_snake_case				)
   return sequence


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   UpperCAmelCase_		 =					input("""Enter numbers separated by commas:\n""").strip()
   UpperCAmelCase_		 =					[int(item.strip()) for item in user_input.split(""",""")]
   print(f'{dutch_national_flag_sort(unsorted)}')



