



from __future__ import annotations






class 						__magic_name__    :


 def __init__(						self		: List[str]			,						lowerCAmelCase__		: str			,						lowerCAmelCase__		: str    )    ->      Tuple:
   UpperCAmelCase      ,	UpperCAmelCase					      =  text, pattern
   UpperCAmelCase      ,	UpperCAmelCase					      =  len(lowerCAmelCase__    ), len(lowerCAmelCase__    )


 def _UpperCamelCase	(						self		: Union[str, Any]			,						lowerCAmelCase__		: str    )    ->      int:

   for i in range(self.patLen - 1			,						-1			,						-1    ):
     if char == self.pattern[i]:
       return i
   return -1


 def _UpperCamelCase	(						self		: int			,						lowerCAmelCase__		: int    )    ->      int:

   for i in range(self.patLen - 1			,						-1			,						-1    ):
     if self.pattern[i] != self.text[current_pos + i]:
       return current_pos + i
   return -1


 def _UpperCamelCase	(						self		: List[Any]    )    ->      list[int]:
   # searches pattern in text and returns index positions
   UpperCAmelCase					      =  []
   for i in range(self.textLen - self.patLen + 1    ):
     UpperCAmelCase					      =  self.mismatch_in_text(lowerCAmelCase__    )
     if mismatch_index == -1:
       positions.append(lowerCAmelCase__    )
     else:
       UpperCAmelCase					      =  self.match_in_pattern(self.text[mismatch_index]    )
       UpperCAmelCase					      =  (
           mismatch_index - match_index
       )  # shifting index lgtm [py/multiple-definition]
   return positions

lowerCAmelCase__       = "ABAABA"
lowerCAmelCase__       = "AB"
lowerCAmelCase__       = BoyerMooreSearch(text, pattern)
lowerCAmelCase__       = bms.bad_character_heuristic()

if len(positions) == 0:
      print("No match found")
else:
      print("Pattern found in following positions: ")
      print(positions)






def      _lowerCAmelCase(	__A   ,       __A   ,       __A			):
  if n == 0:
    return 1

  elif n % 2 == 1:
    return (binary_exponentiation(__A   ,       n - 1   ,       __A			) * a) % mod

  else:
    UpperCAmelCase					      =  binary_exponentiation(__A   ,       n / 2   ,       __A			)
    return (b * b) % mod


# a prime number
lowerCAmelCase__       = 701

lowerCAmelCase__       = 1000000000
lowerCAmelCase__       = 10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)





print((a / b) % p == (a * b ** (p - 2)) % p)



