

from __future__ import annotations

from typing import Generic, TypeVar

SCREAMING_SNAKE_CASE		:Tuple				  =    TypeVar("""T""")






class 	__magic_name__				(       snake_case							):
     pass






class 	__magic_name__				(       snake_case							):
     pass






class 	__magic_name__				(       Generic[T]							):






     def __init__(							self		,	_lowercase = 10  )->    Optional[Any]:
         UpperCamelCase_      =	[]
         UpperCamelCase_      =	limit






     def __bool__(							self  )->    bool:
         return bool(self.stack  )






     def __str__(							self  )->    str:
         return str(self.stack  )






     def   UpperCAmelCase_							(							self		,	_lowercase  )->    None:
         if len(self.stack  ) >= self.limit:
             raise StackOverflowError
         self.stack.append(_lowercase  )






     def   UpperCAmelCase_							(							self  )->    T:
         if not self.stack:
             raise StackUnderflowError
         return self.stack.pop()






     def   UpperCAmelCase_							(							self  )->    T:
         if not self.stack:
             raise StackUnderflowError
         return self.stack[-1]






     def   UpperCAmelCase_							(							self  )->    bool:
         return not bool(self.stack  )






     def   UpperCAmelCase_							(							self  )->    bool:
         return self.size() == self.limit






     def   UpperCAmelCase_							(							self  )->    int:
         return len(self.stack  )






     def __contains__(							self		,	_lowercase  )->    bool:
         return item in self.stack




def  lowerCAmelCase(			)->	None:



    """simple docstring"""






    UpperCamelCase_      =	Stack(1_0 )
    assert bool(SCREAMING_SNAKE_CASE_ ) is False
    assert stack.is_empty() is True
    assert stack.is_full() is False
    assert str(SCREAMING_SNAKE_CASE_ ) == "[]"

    try:
        UpperCamelCase_      =	stack.pop()
        raise AssertionError  # This should not happen
    except StackUnderflowError:
        assert True  # This should happen

    try:
        UpperCamelCase_      =	stack.peek()
        raise AssertionError  # This should not happen
    except StackUnderflowError:
        assert True  # This should happen

    for i in range(1_0 ):
        assert stack.size() == i
        stack.push(SCREAMING_SNAKE_CASE_ )

    assert bool(SCREAMING_SNAKE_CASE_ )
    assert not stack.is_empty()
    assert stack.is_full()
    assert str(SCREAMING_SNAKE_CASE_ ) == str(list(range(1_0 ) ) )
    assert stack.pop() == 9
    assert stack.peek() == 8

    stack.push(1_0_0 )
    assert str(SCREAMING_SNAKE_CASE_ ) == str([0, 1, 2, 3, 4, 5, 6, 7, 8, 1_0_0] )

    try:
        stack.push(2_0_0 )
        raise AssertionError  # This should not happen
    except StackOverflowError:
        assert True  # This should happen

    assert not stack.is_empty()
    assert stack.size() == 1_0

    assert 5 in stack
    assert 5_5 not in stack


if __name__ == "__main__":
 test_stack()



def  lowerCAmelCase(			SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ ,	SCREAMING_SNAKE_CASE_ )->	str:



    """simple docstring"""






    if power < 0:
        return -1
    base %= mod
    UpperCamelCase_      =	1

    while power > 0:
        if power & 1:
            UpperCamelCase_      =	(result * base) % mod
        UpperCamelCase_      =	power >> 1
        UpperCamelCase_      =	(base * base) % mod

    return result




def  lowerCAmelCase(			)->	Tuple:



    """simple docstring"""






    print(modular_exponential(3 ,	2_0_0 ,	1_3 ) )


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 main()
