




from .number_theory.prime_numbers import next_prime






class     SCREAMING_SNAKE_CASE__      :

							"""simple docstring"""






							def __init__(					self       ,		SCREAMING_SNAKE_CASE_       ,		SCREAMING_SNAKE_CASE_ = None       ,		SCREAMING_SNAKE_CASE_ = None       ,		)->				None:





													'''simple docstring'''






													__UpperCamelCase       					=     size_table
													__UpperCamelCase       					=     [None] * self.size_table
													__UpperCamelCase       					=     0.7_5 if lim_charge is None else lim_charge
													__UpperCamelCase       					=     1 if charge_factor is None else charge_factor
													__UpperCamelCase       					=     []
													__UpperCamelCase       					=     {}



							def       A__						(					self     )->				List[str]:





													'''simple docstring'''






													return self._keys



							def       A__						(					self     )->				Optional[Any]:





													'''simple docstring'''






													return sum(1 for slot in self.values if slot is not None     ) / (
													    self.size_table * self.charge_factor
													)



							def       A__						(					self       ,		SCREAMING_SNAKE_CASE_     )->				Optional[int]:





													'''simple docstring'''






													return key % self.size_table



							def       A__						(					self       ,		SCREAMING_SNAKE_CASE_     )->				str:





													'''simple docstring'''






													print(F"step {step_ord}"     )
													print(list(range(len(self.values     )     )     )     )
													print(self.values     )



							def       A__						(					self       ,		SCREAMING_SNAKE_CASE_     )->				Dict:





													'''simple docstring'''






													__UpperCamelCase       					=     1
													__UpperCamelCase       					=     values
													for value in values:
																			self.insert_data(SCREAMING_SNAKE_CASE_     )
																			self._step_by_step(SCREAMING_SNAKE_CASE_     )
																			i += 1



							def       A__						(					self       ,		SCREAMING_SNAKE_CASE_       ,		SCREAMING_SNAKE_CASE_     )->				Union[str, Any]:





													'''simple docstring'''






													__UpperCamelCase       					=     data
													__UpperCamelCase       					=     data



							def       A__						(					self       ,		SCREAMING_SNAKE_CASE_       ,		SCREAMING_SNAKE_CASE_=None     )->				Tuple:





													'''simple docstring'''






													__UpperCamelCase       					=     self.hash_function(key + 1     )

													while self.values[new_key] is not None and self.values[new_key] != key:
																			if self.values.count(SCREAMING_SNAKE_CASE_     ) > 0:
																									__UpperCamelCase       					=     self.hash_function(new_key + 1     )
																			else:
																									__UpperCamelCase       					=     None
																									break

													return new_key



							def       A__						(					self     )->				Union[str, Any]:





													'''simple docstring'''






													__UpperCamelCase       					=     [value for value in self.values if value is not None]
													__UpperCamelCase       					=     next_prime(self.size_table       ,		factor=2     )
													self._keys.clear()
													__UpperCamelCase       					=     [None] * self.size_table  # hell's pointers D: don't DRY ;/
													for value in survivor_values:
																			self.insert_data(SCREAMING_SNAKE_CASE_     )



							def       A__						(					self       ,		SCREAMING_SNAKE_CASE_     )->				int:





													'''simple docstring'''






													__UpperCamelCase       					=     self.hash_function(SCREAMING_SNAKE_CASE_     )

													if self.values[key] is None:
																			self._set_value(SCREAMING_SNAKE_CASE_       ,		SCREAMING_SNAKE_CASE_     )

													elif self.values[key] == data:
																			pass

													else:
																			__UpperCamelCase       					=     self._collision_resolution(SCREAMING_SNAKE_CASE_       ,		SCREAMING_SNAKE_CASE_     )
																			if collision_resolution is not None:
																									self._set_value(SCREAMING_SNAKE_CASE_       ,		SCREAMING_SNAKE_CASE_     )
																			else:
																									self.rehashing()
																									self.insert_data(SCREAMING_SNAKE_CASE_     )






def 		A_	(							snake_case							:				Union[str, Any]	, snake_case							:				Tuple	, snake_case							:				Optional[Any]	) ->      Union[str, 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(snake_case	, n - 1	, snake_case	) * a) % b

						__UpperCamelCase       					=     bin_exp_mod(snake_case	, n / 2	, snake_case	)
						return (r * r) % b


if __name__ == "__main__":
				try:
								lowercase__							:							Dict													=     int(input("Enter Base : ").strip())
								lowercase__							:							Dict													=     int(input("Enter Power : ").strip())
								lowercase__							:							Dict													=     int(input("Enter Modulo : ").strip())
				except ValueError:
								print("Invalid literal for integer")

				print(bin_exp_mod(BASE, POWER, MODULO))




