



from __future__ import annotations

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

_snake_case	=						TypeVar("T")



class 						UpperCAmelCase_					( Generic[T]):







							def __init__(     self,    __a):

														'''simple docstring'''

														_lowerCAmelCase  :							Optional[Any]				     =					data
														_lowerCAmelCase  :							Node[T] | None				     =					None







							def __str__(     self):

														'''simple docstring'''

														return f"{self.data}"



class 						UpperCAmelCase_					( Generic[T]):







							def __init__(     self):

														'''simple docstring'''

														_lowerCAmelCase  :							Node[T] | None				     =					None







							def __iter__(     self):

														'''simple docstring'''

														_lowerCAmelCase  :							str				     =					self.top
														while node:
																					yield node.data
																					_lowerCAmelCase  :							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      snake_case__   (     self):

														'''simple docstring'''

														return self.top is None







							def      snake_case__   (     self,    __a):

														'''simple docstring'''

														_lowerCAmelCase  :							Tuple				     =					Node(__a)
														if not self.is_empty():
																					_lowerCAmelCase  :							int				     =					self.top
														_lowerCAmelCase  :							List[str]				     =					node







							def      snake_case__   (     self):

														'''simple docstring'''

														if self.is_empty():
																					raise IndexError("pop from empty stack")
														assert isinstance(self.top,    __a)
														_lowerCAmelCase  :							List[Any]				     =					self.top
														_lowerCAmelCase  :							Union[str, Any]				     =					self.top.next
														return pop_node.data







							def      snake_case__   (     self):

														'''simple docstring'''

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

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







							def      snake_case__   (     self):

														'''simple docstring'''

														_lowerCAmelCase  :							Optional[int]				     =					None


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

			testmod()





from __future__ import annotations






def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							if not nums:
														raise ValueError("List is empty"						)
							return sum(_lowerCamelCase						) / len(_lowerCamelCase						)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
