






"""simple docstring"""
import operator as op






def 			__UpperCamelCase	(		snake_case__					):
	A_		:						List[str]	    =   []
	A_		:						List[str]	    =   lambda snake_case__   ,   snake_case__					: int(x / y					)  # noqa: E731 integer division operation
	A_		:						Tuple	    =   {
	    """^""": 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(UpperCamelCase__					))					)

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

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

			stack.append(
			    str(opr[x](int(UpperCamelCase__					)   ,   int(UpperCamelCase__					)					)					)					)  # 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(UpperCamelCase__					)   ,   sep=""" | """   ,   )

	return int(stack[0]					)


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









"""simple docstring"""
_lowerCAmelCase         =							{"a": ["c", "b"], "b": ["d", "e"], "c": [], "d": [], "e": []}
_lowerCAmelCase         =							["a", "b", "c", "d", "e"]






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__   ,   snake_case__					):
	A_		:						int	    =   start
	# add current to visited
	visited.append(snake_case__					)
	A_		:						Any	    =   edges[current]
	for neighbor in neighbors:
		# if neighbor not in visited, visit
		if neighbor not in visited:
			A_		:						Optional[Any]	    =   topological_sort(snake_case__   ,   snake_case__   ,   snake_case__					)
    # if all neighbors visited add current to sort
	sort.append(snake_case__					)
	# if all vertices haven't been visited select a new one to visit
	if len(snake_case__					) != len(snake_case__					):
		for vertice in vertices:
			if vertice not in visited:
				A_		:						Optional[Any]	    =   topological_sort(snake_case__   ,   snake_case__   ,   snake_case__					)
    # return sort
	return sort


if __name__ == "__main__":
							_lowerCAmelCase         =							topological_sort("a", [], [])
							print(sort)

