from __future__ import annotations



class  UpperCamelCase				:

     '''simple docstring'''

     def __init__(					self				,				A_				,				A_						) ->				int:






           """simple docstring"""
           _lowerCamelCase    ,					_lowerCamelCase			    =				text, pattern
           _lowerCamelCase    ,					_lowerCamelCase			    =				len(A_						), len(A_						)



     def 		UpperCamelCase_						(					self				,				A_						) ->				int:






           """simple docstring"""

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



     def 		UpperCamelCase_						(					self				,				A_						) ->				int:






           """simple docstring"""

           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[int]:






           """simple docstring"""
           # searches pattern in text and returns index positions
           _lowerCamelCase			    =				[]
           for i in range(self.textLen - self.patLen + 1						):
                 _lowerCamelCase			    =				self.mismatch_in_text(A_						)
                 if mismatch_index == -1:
                       positions.append(A_						)
                 else:
                       _lowerCamelCase			    =				self.match_in_pattern(self.text[mismatch_index]						)
                       _lowerCamelCase			    =				(
                           mismatch_index - match_index
                       )  # shifting index lgtm [py/multiple-definition]
           return positions





snake_case__				= 'ABAABA'
snake_case__				= 'AB'
snake_case__				= BoyerMooreSearch(text, pattern)
snake_case__				= bms.bad_character_heuristic()

if len(positions) == 0:
     print('No match found')
else:
     print('Pattern found in following positions: ')
     print(positions)
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase		)						->    str:



      '''simple docstring'''

      _lowerCamelCase			    =				0
      while b > 0:
            if b & 1:
                  res += a

            a += a
            b >>= 1

      return res
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase ,						__UpperCAmelCase		)						->    Optional[Any]:



      '''simple docstring'''

      _lowerCamelCase			    =				0
      while b > 0:
            if b & 1:
                  _lowerCamelCase			    =				((res % c) + (a % c)) % c

            a += a
            b >>= 1

      return res