
'''simple docstring'''





from .hash_table import HashTable
from .number_theory.prime_numbers import is_prime, next_prime


class  UpperCamelCase__  (    lowerCAmelCase__):






 def __init__(			self  :List[str]	,				*_A  :int	,				**_A  :int			)				->			Union[str, Any]:







       '''simple docstring'''



       super().__init__(*lowerCAmelCase_	,				**lowerCAmelCase_			)






 def 	lowercase_						(			self  :Tuple	,				_A  :Optional[int]	,				_A  :Any			)				->			int:







       '''simple docstring'''



       __A       	=			(
           next_prime(value % self.size_table			)
           if not is_prime(value % self.size_table			)
           else value % self.size_table
       )  # gt = bigger than
       return next_prime_gt - (data % next_prime_gt)






 def 	lowercase_						(			self  :Any	,				_A  :int	,				_A  :int	,				_A  :List[Any]			)				->			Dict:







       '''simple docstring'''



       return (increment * self.__hash_function_a(lowerCAmelCase_	,				lowerCAmelCase_			)) % self.size_table






 def 	lowercase_						(			self  :int	,				_A  :Dict	,				_A  :Tuple=None			)				->			List[str]:







       '''simple docstring'''



       __A       	=			1
       __A       	=			self.hash_function(lowerCAmelCase_			)

       while self.values[new_key] is not None and self.values[new_key] != key:
             __A       	=			(
                 self.__hash_double_function(lowerCAmelCase_	,				lowerCAmelCase_	,				lowerCAmelCase_			)
                 if self.balanced_factor() >= self.lim_charge
                 else None
             )
             if new_key is None:
                   break
             else:
                   i += 1

       return new_key








'''simple docstring'''





def        snake_case							(		UpperCAmelCase      ,  UpperCAmelCase      ,  UpperCAmelCase	)->			str:







      """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(UpperCAmelCase      ,  n - 1      ,  UpperCAmelCase	) * a) % b

      __A       	=			bin_exp_mod(UpperCAmelCase      ,  n / 2      ,  UpperCAmelCase	)
      return (r * r) % b


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

 print(bin_exp_mod(BASE, POWER, MODULO))






