



"""simple docstring"""






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

lowerCAmelCase__        =				TypeVar('''_T''')






class        __snake_case       (	Generic[_T]):




  def __init__( self     :						Dict						,					__lowerCAmelCase     :						Iterable[_T] | None = None		):






         """simple docstring"""






         _lowerCamelCase						:				list[_T]    			= list(iterable or []		)
         _lowerCamelCase						:				list[_T]    			= []




  def __len__( self     :						Union[str, Any]		):






         """simple docstring"""






         return len(self._stacka		) + len(self._stacka		)




  def __repr__( self     :						List[str]		):






         """simple docstring"""






         return f'''Queue({tuple(self._stacka[::-1] + self._stacka		)})'''




  def 						SCREAMING_SNAKE_CASE				( self     :						Dict						,					__lowerCAmelCase     :						_T		):






         """simple docstring"""






         self._stacka.append(__lowerCAmelCase		)




  def 						SCREAMING_SNAKE_CASE				( self     :						int		):






         """simple docstring"""






         _lowerCamelCase						:				Any    			= self._stacka.pop
         _lowerCamelCase						:				Any    			= self._stacka.append

         if not self._stacka:
                while self._stacka:
                       stacka_append(stacka_pop()		)

         if not self._stacka:
                raise IndexError('''Queue is empty'''		)
         return self._stacka.pop()


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

   testmod()







from __future__ import annotations

class 		UpperCAmelCase__			:




			'''simple docstring'''






			def __init__(   self							: Optional[Any]       ,       a_							: Optional[int]=None ):
					'''simple docstring'''





					__UpperCAmelCase    :     Optional[Any]													=	data
					__UpperCAmelCase    :     Any													=	None




			def __repr__(   self							: Tuple ):
					'''simple docstring'''





					__UpperCAmelCase    :     Dict													=	[]
					__UpperCAmelCase    :     Any													=	self
					while temp:
							string_rep.append(F'{temp.data}' )
							__UpperCAmelCase    :     Dict													=	temp.next
					return "->".join(a_ )

def        a						(      _UpperCAmelCase							:					list						):







		'''simple docstring'''





		if not elements_list:
				raise Exception('''The Elements List is empty'''						)

		__UpperCAmelCase    :     int													=	Node(elements_list[0]						)
		for i in range(1 ,   len(_UpperCAmelCase						)						):
				__UpperCAmelCase    :     Any													=	Node(elements_list[i]						)
				__UpperCAmelCase    :     Optional[int]													=	current.next
		return head

def        a						(      _UpperCAmelCase							:					Node						):







		'''simple docstring'''





		if head_node is not None and isinstance(_UpperCAmelCase ,   _UpperCAmelCase						):
				print_reverse(head_node.next						)
				print(head_node.data						)

def        a						(      ):







		'''simple docstring'''





		from doctest import testmod

		testmod()

		__UpperCAmelCase    :     Tuple													=	make_linked_list([14, 52, 14, 12, 43]						)
		print('''Linked List:'''						)
		print(_UpperCAmelCase						)
		print('''Elements in Reverse:'''						)
		print_reverse(_UpperCAmelCase						)


if __name__ == "__main__":
				main()





