



from __future__ import annotations

class        UpperCAmelCase_  :

						'''simple docstring'''




						def __init__(   self				,							_A				,							_A		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE							,	__SCREAMING_SNAKE_CASE									= text, pattern
													__SCREAMING_SNAKE_CASE							,	__SCREAMING_SNAKE_CASE									= len(_A		), len(_A		)






						def 	_A     (   self				,							_A		):







													'''simple docstring'''

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






						def 	_A     (   self				,							_A		):







													'''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 	_A     (   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= []
													for i in range(self.textLen - self.patLen + 1		):
																				__SCREAMING_SNAKE_CASE									= self.mismatch_in_text(_A		)
																				if mismatch_index == -1:
																											positions.append(_A		)
																				else:
																											__SCREAMING_SNAKE_CASE									= self.match_in_pattern(self.text[mismatch_index]		)
																											__SCREAMING_SNAKE_CASE									= (
																											    mismatch_index - match_index
																											)  # shifting index lgtm [py/multiple-definition]
													return positions







lowerCAmelCase__		:					Optional[Any]							='''ABAABA'''
lowerCAmelCase__		:					List[str]							='''AB'''
lowerCAmelCase__		:					Tuple							=BoyerMooreSearch(text, pattern)
lowerCAmelCase__		:					Any							=bms.bad_character_heuristic()

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











def      __lowercase       (			a__       )    ->			int:
							__SCREAMING_SNAKE_CASE									= [[0 for _ in range(a__       )] for _ in range(m + 1       )]
							for i in range(m + 1       ):
														__SCREAMING_SNAKE_CASE									= 1

							for n in range(m + 1       ):
														for k in range(1							,       a__       ):
																					memo[n][k] += memo[n][k - 1]
																					if n - k > 0:
																												memo[n][k] += memo[n - k - 1][k]

							return memo[m][m - 1]


if __name__ == "__main__":
			import sys

			if len(sys.argv) == 1:
						try:
									lowerCAmelCase__		:					Optional[Any]							=int(input('''Enter a number: ''').strip())
									print(partition(n))
						except ValueError:
									print('''Please enter a number.''')
			else:
						try:
									lowerCAmelCase__		:					str							=int(sys.argv[1])
									print(partition(n))
						except ValueError:
									print('''Please pass a number.''')






