
'''simple docstring'''



_lowercase    =		'''Alexander Joslin'''

import operator as op

from .stack import Stack


def A				(__lowerCamelCase				:str		):
						_lowerCAmelCase  						=			{"*": op.mul, "/": op.truediv, "+": op.add, "-": op.sub}

						_lowerCAmelCase  						=			Stack()
						_lowerCAmelCase  						=			Stack()

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

																		_lowerCAmelCase  						=			operators[opr](_lowerCAmelCase			,     _lowerCAmelCase		)
																		operand_stack.push(_lowerCAmelCase		)

    # RULE 5
						return operand_stack.peek()


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


'''simple docstring'''



import os


def A				():
						with open(os.path.dirname(__lowerCamelCase		) + """/grid.txt"""		) as f:
												_lowerCAmelCase  						=			[]  # noqa: E741
												for _ in range(20		):
																		l.append([int(__lowerCamelCase		) for x in f.readline().split()]		)

												_lowerCAmelCase  						=			0

												# right
												for i in range(20		):
																		for j in range(17		):
																								_lowerCAmelCase  						=			l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp

        # down
												for i in range(17		):
																		for j in range(20		):
																								_lowerCAmelCase  						=			l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp

        # diagonal 1
												for i in range(17		):
																		for j in range(17		):
																								_lowerCAmelCase  						=			l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp

        # diagonal 2
												for i in range(17		):
																		for j in range(3			,     20		):
																								_lowerCAmelCase  						=			l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
																								if temp > maximum:
																														_lowerCAmelCase  						=			temp
												return maximum


if __name__ == "__main__":
						print(solution())
