




"""simple docstring"""







def 						snake_case__       (					_lowerCamelCase,  _lowerCamelCase				)			->int:






		"""simple docstring"""


		while a != 0:
				__lowercase						,__lowercase				:		List[Any]												=				b % a, a
		return b





def 						snake_case__       (					_lowerCamelCase,  _lowerCamelCase				)			->int:






		"""simple docstring"""


		if gcd(_lowerCamelCase,  _lowerCamelCase				) != 1:
				__lowercase				:		Dict												=				F'mod inverse of {a!r} and {m!r} does not exist'
				raise ValueError(_lowerCamelCase				)
		__lowercase						,__lowercase						,__lowercase				:		Optional[int]												=				1, 0, a
		__lowercase						,__lowercase						,__lowercase				:		Optional[int]												=				0, 1, m
		while va != 0:
				__lowercase				:		str												=				ua // va
				__lowercase						,__lowercase						,__lowercase						,__lowercase						,__lowercase						,__lowercase				:		Union[str, Any]												=				(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
		return ua % m






"""simple docstring"""







from collections import deque

from .hash_table import HashTable




class       lowerCAmelCase__       (			lowerCAmelCase_    ):


				"""simple docstring"""





				def __init__(     self					:	Optional[int]    ,   *lowercase__					:	Any    ,   **lowercase__					:	Union[str, Any]						):
						super().__init__(*lowercase__    ,   **lowercase__						)



				def       snake_case    (     self					:	Any    ,   lowercase__					:	Dict    ,   lowercase__					:	Dict						):
						__lowercase				:		Dict												=				deque([]						) if self.values[key] is None else self.values[key]
						self.values[key].appendleft(lowercase__						)
						__lowercase				:		Union[str, Any]												=				self.values[key]



				def       snake_case    (     self					:	str						):
						return (
						    sum(self.charge_factor - len(lowercase__						) for slot in self.values						)
						    / self.size_table
						    * self.charge_factor
						)



				def       snake_case    (     self					:	Union[str, Any]    ,   lowercase__					:	List[str]    ,   lowercase__					:	str=None						):
						if not (
						    len(self.values[key]						) == self.charge_factor and self.values.count(lowercase__						) == 0
						):
								return key
						return super()._collision_resolution(lowercase__    ,   lowercase__						)
