


'''simple docstring'''





UpperCAmelCase__  			=				'''Alexander Joslin'''

import operator as op

from .stack import Stack






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: str ):






			"""simple docstring"""




			__A=	{'*': op.mul, '/': op.truediv, '+': op.add, '-': op.sub}

			__A=	Stack()
			__A=	Stack()

			for i in equation:
						if i.isdigit():
									# RULE 1
									operand_stack.push(int(_SCREAMING_SNAKE_CASE ) )
						elif i in operators:
									# RULE 2
									operator_stack.push(_SCREAMING_SNAKE_CASE )
						elif i == ")":
									# RULE 4
									__A=	operator_stack.peek()
									operator_stack.pop()
									__A=	operand_stack.peek()
									operand_stack.pop()
									__A=	operand_stack.peek()
									operand_stack.pop()

									__A=	operators[opr](_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE )
									operand_stack.push(_SCREAMING_SNAKE_CASE )

    # RULE 5
			return operand_stack.peek()


if __name__ == "__main__":
					UpperCAmelCase__  			=				'''(5 + ((4 * 2) * (2 + 3)))'''
					# answer = 45
					print(F"""{equation} = {dijkstras_two_stack_algorithm(equation)}""")







'''simple docstring'''





def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int,_SCREAMING_SNAKE_CASE					: int,_SCREAMING_SNAKE_CASE					: int ):






			"""simple docstring"""




			if exponent == 1:
						return base
			if exponent % 2 == 0:
						__A=	_modexpt(_SCREAMING_SNAKE_CASE,exponent // 2,_SCREAMING_SNAKE_CASE ) % modulo_value
						return (x * x) % modulo_value
			else:
						return (base * _modexpt(_SCREAMING_SNAKE_CASE,exponent - 1,_SCREAMING_SNAKE_CASE )) % modulo_value






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int = 1777,_SCREAMING_SNAKE_CASE					: int = 1855,_SCREAMING_SNAKE_CASE					: int = 8 ):






			"""simple docstring"""




			__A=	base
			for _ in range(1,_SCREAMING_SNAKE_CASE ):
						__A=	_modexpt(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE,10**digits )

			return result


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



