

'''simple docstring'''

from __future__ import annotations

from typing import Generic, TypeVar

a       :      Dict						=			TypeVar("T")







class   UpperCamelCase__   (       Generic[T]       ):


		"""simple docstring"""

		def __init__(			self   ,      snake_case      ):


							'''simple docstring'''

							UpperCAmelCase		:							Tuple        =       data  # Assign data
							UpperCAmelCase		:							Node[T] | None        =       None  # Initialize next as null
							UpperCAmelCase		:							Node[T] | None        =       None  # Initialize prev as null







class   UpperCamelCase__   (       Generic[T]       ):


		"""simple docstring"""

		def __init__(			self      ):


							'''simple docstring'''

							UpperCAmelCase		:							Node[T] | None        =       None







		def 				A_	(			self   ,      snake_case      ):


							'''simple docstring'''

							if self.head is None:
												UpperCAmelCase		:							Any        =       Node(__A      )
							else:
												UpperCAmelCase		:							str        =       Node(__A      )
												UpperCAmelCase		:							Optional[Any]        =       new_node
												UpperCAmelCase		:							List[str]        =       self.head
												UpperCAmelCase		:							Optional[int]        =       None
												UpperCAmelCase		:							List[Any]        =       new_node







		def 				A_	(			self      ):


							'''simple docstring'''

							if self.head is None:
												return None
							else:
												assert self.head is not None
												UpperCAmelCase		:							Tuple        =       self.head.data
												UpperCAmelCase		:							List[str]        =       self.head.next
												if self.head is not None:
																	UpperCAmelCase		:							Optional[int]        =       None
												return temp







		def 				A_	(			self      ):


							'''simple docstring'''

							return self.head.data if self.head is not None else None







		def __len__(			self      ):


							'''simple docstring'''

							UpperCAmelCase		:							str        =       self.head
							UpperCAmelCase		:							List[Any]        =       0
							while temp is not None:
												count += 1
												UpperCAmelCase		:							Tuple        =       temp.next
							return count







		def 				A_	(			self      ):


							'''simple docstring'''

							return self.head is None







		def 				A_	(			self      ):


							'''simple docstring'''

							print("stack elements are:"      )
							UpperCAmelCase		:							Tuple        =       self.head
							while temp is not None:
												print(temp.data   ,      end="->"      )
												UpperCAmelCase		:							Optional[Any]        =       temp.next


# Code execution starts here
if __name__ == "__main__":
				# Start with the empty stack
				a       :      Tuple						=			Stack()

				# Insert 4 at the beginning. So stack becomes 4->None
				print("Stack operations using Doubly LinkedList")
				stack.push(4)

				# Insert 5 at the beginning. So stack becomes 4->5->None
				stack.push(5)

				# Insert 6 at the beginning. So stack becomes 4->5->6->None
				stack.push(6)

				# Insert 7 at the beginning. So stack becomes 4->5->6->7->None
				stack.push(7)

				# Print the stack
				stack.print_stack()

				# Print the top element
				print("\nTop element is ", stack.top())

				# Print the stack size
				print("Size of the stack is ", len(stack))

				# pop the top element
				stack.pop()

				# pop the top element
				stack.pop()

				# two elements have now been popped off
				stack.print_stack()

				# Print True if the stack is empty else False
				print("\nstack is empty:", stack.is_empty())



'''simple docstring'''

def 				lowercase (					__magic_name__			,   __magic_name__							):



					'''simple docstring'''







					UpperCAmelCase		:							Dict        =       1.0
					for i in range(1			,   r + 1							):
										ret *= (n + 1 - i) / i
					return round(__magic_name__							)





def 				lowercase (					__magic_name__							):



					'''simple docstring'''







					return choose(8 + n			,   __magic_name__							) + choose(9 + n			,   __magic_name__							) - 10





def 				lowercase (					__magic_name__							):



					'''simple docstring'''







					return sum(non_bouncy_exact(__magic_name__							) for i in range(1			,   n + 1							)							)





def 				lowercase (					__magic_name__ = 100							):



					'''simple docstring'''







					return non_bouncy_upto(__magic_name__							)


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