

import enum
import shutil
import sys


lowercase_   							=  shutil.get_terminal_size()

lowercase_   							=  {'UP': 'A', 'DOWN': 'B', 'RIGHT': 'C', 'LEFT': 'D'}





class 					__lowerCAmelCase	(   enum.Enum				):
  _a		     =    0
  _a		     =    1
def 	a (     A__      :  Union[str, Any] ,  A__      :  Dict=""	)       -> Dict:





      """simple docstring"""



      sys.stdout.write(str(_lowerCamelCase	) + end	)
      sys.stdout.flush()
def 	a (     A__      :  Optional[int] ,  A__      :  List[str] ,  A__      :  Any=""	)       -> Tuple:





      """simple docstring"""



      forceWrite(F'''\u001b[{color}m{content}\u001b[0m''' ,  _lowerCamelCase	)
def 	a (     )       -> Tuple:





      """simple docstring"""



      forceWrite('\r'	)
def 	a (     A__      :  int ,  A__      :  str	)       -> Union[str, Any]:





      """simple docstring"""



      forceWrite(F'''\033[{num_lines}{CURSOR_TO_CHAR[direction.upper()]}'''	)
def 	a (     )       -> Union[str, Any]:





      """simple docstring"""



      forceWrite(' ' * TERMINAL_WIDTH	)
      reset_cursor()







def 	a (     )       -> int:





      """simple docstring"""



      reset_cursor()
      forceWrite('-' * TERMINAL_WIDTH	)




from __future__ import annotations




class 					lowerCamelCase__				:




	'''simple docstring'''




	def __init__(   self						:Dict	,  a						:str	,  a						:str		)						->					Union[str, Any]:
								__UpperCamelCase  ,		__UpperCamelCase      :  Optional[int]       =   text, pattern
								__UpperCamelCase  ,		__UpperCamelCase      :  Tuple       =   len(a		), len(a		)







	def   _lowerCamelCase							(   self						:Any	,  a						:str		)						->					int:

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







	def   _lowerCamelCase							(   self						:str	,  a						: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   _lowerCamelCase							(   self						:Union[str, Any]		)						->					list[int]:
								# searches pattern in text and returns index positions
								__UpperCamelCase      :  Any       =   []
								for i in range(self.textLen - self.patLen + 1		):
															__UpperCamelCase      :  List[Any]       =   self.mismatch_in_text(a		)
															if mismatch_index == -1:
																						positions.append(a		)
															else:
																						__UpperCamelCase      :  Any       =   self.match_in_pattern(self.text[mismatch_index]		)
																						__UpperCamelCase      :  Dict       =   (
																						    mismatch_index - match_index
																						)  # shifting index lgtm [py/multiple-definition]
								return positions
lowercase    :   Any						=			'ABAABA'
lowercase    :   str						=			'AB'
lowercase    :   str						=			BoyerMooreSearch(text, pattern)
lowercase    :   Union[str, Any]						=			bms.bad_character_heuristic()

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