

snake_case_        =			[sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(100_000)]

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



					'''simple docstring'''





					lowercase__   :       Optional[Any]				=	0
					while number:
										# Increased Speed Slightly by checking every 5 digits together.
										sum_of_digits_squared += DIGITS_SQUARED[number % 100_000]
										number //= 100_000

					return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
snake_case_        =			[None] * 10_000_000
snake_case_        =			True
snake_case_        =			False

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



					'''simple docstring'''





					if CHAINS[number - 1] is not None:
										return CHAINS[number - 1]  # type: ignore

					lowercase__   :       Tuple				=	chain(next_number(SCREAMING_SNAKE_CASE_      )      )
					lowercase__   :       Tuple				=	number_chain

					while number < 10_000_000:
										lowercase__   :       List[Any]				=	number_chain
										number *= 10

					return number_chain

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int = 10_000_000      ):



					'''simple docstring'''





					for i in range(1     ,					SCREAMING_SNAKE_CASE_      ):
										if CHAINS[i] is None:
															chain(i + 1      )

					return CHAINS[:number].count(SCREAMING_SNAKE_CASE_      )


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							print(F'''{solution() = }''')




from __future__ import annotations


class 				SCREAMING_SNAKE_CASE__ :





    def __init__(				self						,       a						,       a):
         lowercase__				,			lowercase__   :       Dict				=	text, pattern
         lowercase__				,			lowercase__   :       Any				=	len(a), len(a)





    def 				snake_case_    (				self						,       a):

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





    def 				snake_case_    (				self						,       a):

         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 				snake_case_    (				self):
         # searches pattern in text and returns index positions
         lowercase__   :       Any				=	[]
         for i in range(self.textLen - self.patLen + 1):
              lowercase__   :       Optional[Any]				=	self.mismatch_in_text(a)
              if mismatch_index == -1:
                   positions.append(a)
              else:
                   lowercase__   :       Optional[int]				=	self.match_in_pattern(self.text[mismatch_index])
                   lowercase__   :       Optional[Any]				=	(
                       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)

