






import operator as op

def _UpperCAmelCase   (	a						:	int ):
							snake_case__	  =       []
							snake_case__	  =       lambda a  ,					a : int(x / y )  # noqa: E731 integer division operation
							snake_case__	  =       {
							    """^""": op.pow,
							    """*""": op.mul,
							    """/""": div,
							    """+""": op.add,
							    """-""": op.sub,
							}  # operators & their respective operation

							# print table header
							print("""Symbol""".center(8 )  ,					"""Action""".center(12 )  ,					"""Stack"""  ,					sep=""" | """ )
							print("""-""" * (30 + len(a )) )

							for x in post_fix:
														if x.isdigit():  # if x in digit
																					stack.append(a )  # append x to stack
																					# output in tabular format
																					print(x.rjust(8 )  ,					("""push(""" + x + """)""").ljust(12 )  ,					""",""".join(a )  ,					sep=""" | """ )
														else:
																					snake_case__	  =       stack.pop()  # pop stack
																					# output in tabular format
																					print("""""".rjust(8 )  ,					("""pop(""" + b + """)""").ljust(12 )  ,					""",""".join(a )  ,					sep=""" | """ )

																					snake_case__	  =       stack.pop()  # pop stack
																					# output in tabular format
																					print("""""".rjust(8 )  ,					("""pop(""" + a + """)""").ljust(12 )  ,					""",""".join(a )  ,					sep=""" | """ )

																					stack.append(
																					    str(opr[x](int(a )  ,					int(a ) ) ) )  # evaluate the 2 values popped from stack & push result to stack
																					# output in tabular format
																					print(
																					    x.rjust(8 )  ,					("""push(""" + a + x + b + """)""").ljust(12 )  ,					""",""".join(a )  ,					sep=""" | """  ,					)

							return int(stack[0] )


if __name__ == "__main__":
	a__       =     input("""\n\nEnter a Postfix Equation (space separated) = """).split(""" """)
	print("""\n\tResult = """, solve(Postfix))








from collections.abc import Callable

def _UpperCAmelCase   (	a						:	Callable[[float], float]  ,					a						:	float  ,					a						:	float ):
							snake_case__	  =       a
							snake_case__	  =       b
							if function(a ) == 0:  # one of the a or b is a root for the function
														return a
							elif function(a ) == 0:
														return b
							elif (
							    function(a ) * function(a ) > 0
							):  # if none of these are root and they are both positive or negative,
														# then this algorithm can't find the root
														raise ValueError("""could not find root in given interval.""" )
							else:
														snake_case__	  =       start + (end - start) / 2.0
														while abs(start - mid ) > 10**-7:  # until precisely equals to 10^-7
																					if function(a ) == 0:
																												return mid
																					elif function(a ) * function(a ) < 0:
																												snake_case__	  =       mid
																					else:
																												snake_case__	  =       mid
																					snake_case__	  =       start + (end - start) / 2.0
														return mid

def _UpperCAmelCase   (	a						:	float ):
							return x**3 - 2 * x - 5


if __name__ == "__main__":
	print(bisection(f, 1, 1_0_0_0))

	import doctest

	doctest.testmod()
