





from __future__ import annotations

from collections.abc import Iterator
from typing import Generic, TypeVar

__lowerCamelCase			:	List[str]					    =	TypeVar("""T""")



class    A__  (			Generic[T]     ):





      def __init__(					self			,				A_  ):
       '''simple docstring'''




       UpperCamelCase      :   Union[str, Any]			      =  data
       UpperCamelCase      :   Node[T] | None			      =  None





      def __str__(					self  ):
       '''simple docstring'''




       return F"""{self.data}"""



class    A__  (			Generic[T]     ):





      def __init__(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Node[T] | None			      =  None





      def __iter__(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Tuple			      =  self.top
       while node:
        yield node.data
        UpperCamelCase      :   List[str]			      =  node.next





      def __str__(					self  ):
       '''simple docstring'''




       return "->".join([str(A_  ) for item in self]  )





      def __len__(					self  ):
       '''simple docstring'''




       return len(tuple(iter(self  )  )  )





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       return self.top is None





      def 			__UpperCamelCase(					self			,				A_  ):
       '''simple docstring'''




       UpperCamelCase      :   Tuple			      =  Node(A_  )
       if not self.is_empty():
        UpperCamelCase      :   Any			      =  self.top
       UpperCamelCase      :   List[str]			      =  node





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       if self.is_empty():
        raise IndexError("pop from empty stack"  )
       assert isinstance(self.top			,				A_  )
       UpperCamelCase      :   str			      =  self.top
       UpperCamelCase      :   Optional[int]			      =  self.top.next
       return pop_node.data





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       if self.is_empty():
        raise IndexError("peek from empty stack"  )

       assert self.top is not None
       return self.top.data





      def 			__UpperCamelCase(					self  ):
       '''simple docstring'''




       UpperCamelCase      :   Optional[Any]			      =  None


if __name__ == "__main__":
    from doctest import testmod

    testmod()







def 						A_							(	_lowerCAmelCase	)		->					bool:
 return str(_lowerCAmelCase	) == str(_lowerCAmelCase	)[::-1]



def 						A_							(	_lowerCAmelCase	)		->					int:
 return int(_lowerCAmelCase	) + int(str(_lowerCAmelCase	)[::-1]	)



def 						A_							(	_lowerCAmelCase = 1_0000	)		->					int:
 UpperCamelCase      :   List[Any]			      =  []
 for num in range(1				,  _lowerCAmelCase	):
  UpperCamelCase      :   Union[str, Any]			      =  0
  UpperCamelCase      :   List[str]			      =  num
  while iterations < 50:
   UpperCamelCase      :   int			      =  sum_reverse(_lowerCAmelCase	)
   iterations += 1
   if is_palindrome(_lowerCAmelCase	):
    break
  else:
   lychrel_nums.append(_lowerCAmelCase	)
 return len(_lowerCAmelCase	)


if __name__ == "__main__":
    print(f"""{solution() = }""")
