






class        __snake_case:



 def __init__(	self   :   List[str]	):

    """simple docstring"""






    lowercase__						:	dict[int, list[int]]         = {}
    # indexmap keys are an index and it's values are the number at that index
    lowercase__						:	dict[int, int]         = {}



 def 						UpperCAmelCase    (	self   :   Optional[Any] ,		UpperCAmelCase__   :   list | str | range ,		UpperCAmelCase__   :   int	):

    """simple docstring"""






    if isinstance(UpperCAmelCase__ ,		(range, str)	):
       lowercase__						:	int         = list(UpperCAmelCase__	)
    elif not isinstance(UpperCAmelCase__ ,		UpperCAmelCase__	):
       raise TypeError(
           """binary_search_delete() only accepts either a list, range or str"""	)

    lowercase__						:	str         = 0
    lowercase__						:	List[str]         = len(UpperCAmelCase__	) - 1

    while low <= high:
       lowercase__						:	List[str]         = (low + high) // 2
       if array[mid] == item:
          array.pop(UpperCAmelCase__	)
          return array
       elif array[mid] < item:
          lowercase__						:	List[Any]         = mid + 1
       else:
          lowercase__						:	str         = mid - 1
    raise ValueError(
        """Either the item is not in the array or the array was unsorted"""	)



 def 						UpperCAmelCase    (	self   :   List[str] ,		UpperCAmelCase__   :   list | str | range ,		UpperCAmelCase__   :   int	):

    """simple docstring"""






    if isinstance(UpperCAmelCase__ ,		(range, str)	):
       lowercase__						:	Any         = list(UpperCAmelCase__	)
    elif not isinstance(UpperCAmelCase__ ,		UpperCAmelCase__	):
       raise TypeError(
           """binary_search_insert() only accepts either a list, range or str"""	)

    lowercase__						:	Optional[int]         = 0
    lowercase__						:	Optional[Any]         = len(UpperCAmelCase__	) - 1

    while low <= high:
       lowercase__						:	str         = (low + high) // 2
       if array[mid] == index:
          # If the item already exists in the array,
          # insert it after the existing item
          array.insert(mid + 1 ,		UpperCAmelCase__	)
          return array
       elif array[mid] < index:
          lowercase__						:	str         = mid + 1
       else:
          lowercase__						:	Optional[Any]         = mid - 1

        # If the item doesn't exist in the array, insert it at the appropriate position
    array.insert(UpperCAmelCase__ ,		UpperCAmelCase__	)
    return array



 def 						UpperCAmelCase    (	self   :   List[Any] ,		UpperCAmelCase__   :   int ,		UpperCAmelCase__   :   int	):

    """simple docstring"""






    if index in self.indexmap:
       lowercase__						:	Optional[int]         = self.indexmap[index]
       if len(self.numbermap[n]	) == 1:
          del self.numbermap[n]
       else:
          lowercase__						:	List[Any]         = self.binary_search_delete(self.numbermap[n] ,		UpperCAmelCase__	)

        # Set new index
    lowercase__						:	Optional[int]         = number

    # Number not seen before or empty so insert number value
    if number not in self.numbermap:
       lowercase__						:	Optional[Any]         = [index]

    # Here we need to perform a binary search insertion in order to insert
    # The item in the correct place
    else:
       lowercase__						:	int         = self.binary_search_insert(
           self.numbermap[number] ,		UpperCAmelCase__	)







 def 						UpperCAmelCase    (	self   :   Optional[int] ,		UpperCAmelCase__   :   int	):

    """simple docstring"""






    return self.numbermap.get(UpperCAmelCase__ ,		[-1]	)[0]


if __name__ == "__main__":
 import doctest

 doctest.testmod()










a    =       10**8
def       a__						(  A					):
   if n % 10 == 0:
      return False
   lowercase__						:	Optional[Any]         = str(A					)
   return s == s[::-1]
def       a__						(  ):
   lowercase__						:	Union[str, Any]         = set()
   lowercase__						:	Dict         = 1
   lowercase__						:	List[str]         = 5
   while sum_squares < LIMIT:
      lowercase__						:	Tuple         = first_square + 1
      while sum_squares < LIMIT:
         if is_palindrome(A					):
            answer.add(A					)
         last_square += 1
         sum_squares += last_square**2
      first_square += 1
      lowercase__						:	Any         = first_square**2 + (first_square + 1) ** 2

   return sum(A					)


if __name__ == "__main__":
 print(solution())


