


def      _lowerCAmelCase  (							lowerCAmelCase_							:str						,  lowerCAmelCase_							:int						,  lowerCAmelCase_							:List[str]							)->None:
   '''simple docstring'''






   if right <= left:
      return
   snake_case_         =   left
   snake_case_         =   right
   snake_case_         =   sorting[left]
   while i <= b:
      if sorting[i] < pivot:
         snake_case_         =   sorting[i], sorting[a]
         a += 1
         i += 1
      elif sorting[i] > pivot:
         snake_case_         =   sorting[i], sorting[b]
         b -= 1
      else:
         i += 1
   quick_sort_apartition(A__						,  A__						,  a - 1							)
   quick_sort_apartition(A__						,  b + 1						,  A__							)



def      _lowerCAmelCase  (							lowerCAmelCase_							:List[Any]						,  lowerCAmelCase_							:str						,  lowerCAmelCase_							:Tuple							)->None:
   '''simple docstring'''






   if left < right:
      snake_case_         =   lomuto_partition(A__						,  A__						,  A__							)
      quick_sort_lomuto_partition(A__						,  A__						,  pivot_index - 1							)
      quick_sort_lomuto_partition(A__						,  pivot_index + 1						,  A__							)



def      _lowerCAmelCase  (							lowerCAmelCase_							:Any						,  lowerCAmelCase_							:Optional[Any]						,  lowerCAmelCase_							:List[str]							)->int:
   '''simple docstring'''






   snake_case_         =   sorting[right]
   snake_case_         =   left
   for i in range(A__						,  A__							):
      if sorting[i] < pivot:
         snake_case_         =   sorting[i], sorting[store_index]
         store_index += 1
   snake_case_         =   sorting[store_index], sorting[right]
   return store_index



def      _lowerCAmelCase  (							lowerCAmelCase_							:int							)->list:
   '''simple docstring'''






   if len(A__							) <= 1:
      return sorting
   return (
       three_way_radix_quicksort([i for i in sorting if i < sorting[0]]							)
       + [i for i in sorting if i == sorting[0]]
       + three_way_radix_quicksort([i for i in sorting if i > sorting[0]]							)
   )


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)

   SCREAMING_SNAKE_CASE		:Dict											=       input('''Enter numbers separated by a comma:\n''').strip()
   SCREAMING_SNAKE_CASE		:Dict											=       [int(item) for item in user_input.split(''',''')]
   quick_sort_apartition(unsorted, 0, len(unsorted) - 1)
   print(unsorted)








def      _lowerCAmelCase  (							lowerCAmelCase_							:Dict						,  lowerCAmelCase_							:Optional[int]						,  lowerCAmelCase_							:Tuple							)->Optional[Any]:
   '''simple docstring'''






   assert b != 0, "This cannot accept modulo that is == 0"
   if n == 0:
      return 1

   if n % 2 == 1:
      return (bin_exp_mod(lowerCAmelCase_						,  n - 1						,  lowerCAmelCase_							) * a) % b

   snake_case_         =   bin_exp_mod(lowerCAmelCase_						,  n / 2						,  lowerCAmelCase_							)
   return (r * r) % b


if __name__ == "__main__":
   try:
      SCREAMING_SNAKE_CASE		:str											=       int(input('''Enter Base : ''').strip())
      SCREAMING_SNAKE_CASE		:List[Any]											=       int(input('''Enter Power : ''').strip())
      SCREAMING_SNAKE_CASE		:Dict											=       int(input('''Enter Modulo : ''').strip())
   except ValueError:
      print('''Invalid literal for integer''')

   print(bin_exp_mod(BASE, POWER, MODULO))




