
"""simple docstring"""

from __future__ import annotations

from typing import Any






class 	_lowercase       :




	def __init__(			self		,			UpperCAmelCase_ = 6 )		->							None:






			"""simple docstring"""




			lowerCamelCase					:      Node | None          =   None
			lowerCamelCase					:      Node | None          =   None
			self.create_linked_list(UpperCAmelCase_ )




	def       _UpperCamelCase   (			self		,			UpperCAmelCase_ )		->							None:






			"""simple docstring"""




			lowerCamelCase					:      Dict          =   Node()
			lowerCamelCase					:      Any          =   current_node
			lowerCamelCase					:      int          =   current_node
			lowerCamelCase					:      Optional[Any]          =   current_node
			for _ in range(1		,			UpperCAmelCase_ ):
					lowerCamelCase					:      Optional[int]          =   Node()
					lowerCamelCase					:      Dict          =   current_node
					lowerCamelCase					:      Union[str, Any]          =   previous_node
					lowerCamelCase					:      Any          =   current_node
			lowerCamelCase					:      str          =   self.front
			lowerCamelCase					:      Dict          =   previous_node




	def       _UpperCamelCase   (			self )		->							bool:






			"""simple docstring"""




			return (
			    self.front == self.rear
			    and self.front is not None
			    and self.front.data is None
			)




	def       _UpperCamelCase   (			self )		->							Any | None:






			"""simple docstring"""




			self.check_can_perform_operation()
			return self.front.data if self.front else None




	def       _UpperCamelCase   (			self		,			UpperCAmelCase_ )		->							None:






			"""simple docstring"""




			if self.rear is None:
					return

			self.check_is_full()
			if not self.is_empty():
					lowerCamelCase					:      Any          =   self.rear.next
			if self.rear:
					lowerCamelCase					:      List[str]          =   data




	def       _UpperCamelCase   (			self )		->							Any:






			"""simple docstring"""




			self.check_can_perform_operation()
			if self.rear is None or self.front is None:
					return None
			if self.front == self.rear:
					lowerCamelCase					:      str          =   self.front.data
					lowerCamelCase					:      Any          =   None
					return data

			lowerCamelCase					:      str          =   self.front
			lowerCamelCase					:      Optional[int]          =   old_front.next
			lowerCamelCase					:      Dict          =   old_front.data
			lowerCamelCase					:      str          =   None
			return data




	def       _UpperCamelCase   (			self )		->							None:






			"""simple docstring"""




			if self.is_empty():
					raise Exception('Empty Queue' )




	def       _UpperCamelCase   (			self )		->							None:






			"""simple docstring"""




			if self.rear and self.rear.next == self.front:
					raise Exception('Full Queue' )






class 	_lowercase       :




	def __init__(			self )		->							None:






			"""simple docstring"""




			lowerCamelCase					:      Any | None          =   None
			lowerCamelCase					:      Node | None          =   None
			lowerCamelCase					:      Node | None          =   None


if __name__ == "__main__":
					import doctest

					doctest.testmod()








"""simple docstring"""

def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		return str(a_      ) == str(a_      )[::-1]
def 		UpperCAmelCase (		a_      ):





		'''simple docstring'''


		return int(a_      ) + int(str(a_      )[::-1]      )
def 		UpperCAmelCase (		a_ = 1_0000      ):





		'''simple docstring'''


		lowerCamelCase					:      Optional[Any]          =   []
		for num in range(1,						a_      ):
				lowerCamelCase					:      List[str]          =   0
				lowerCamelCase					:      Union[str, Any]          =   num
				while iterations < 50:
						lowerCamelCase					:      Optional[int]          =   sum_reverse(a_      )
						iterations += 1
						if is_palindrome(a_      ):
								break
				else:
						lychrel_nums.append(a_      )
		return len(a_      )


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






