





import operator as op







def   __lowerCamelCase   (				__a  :Optional[int]       )						->							int:






		"""simple docstring"""

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

		# print table header
		print("""Symbol""".center(8       )       ,	"""Action""".center(1_2       )       ,	"""Stack"""       ,	sep=""" | """       )
		print("""-""" * (3_0 + 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(1_2       )       ,	""",""".join(__a       )       ,	sep=""" | """       )
				else:
						A__     =  stack.pop()  # pop stack
						# output in tabular format
						print("""""".rjust(8       )       ,	("""pop(""" + b + """)""").ljust(1_2       )       ,	""",""".join(__a       )       ,	sep=""" | """       )

						A__     =  stack.pop()  # pop stack
						# output in tabular format
						print("""""".rjust(8       )       ,	("""pop(""" + a + """)""").ljust(1_2       )       ,	""",""".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(1_2       )       ,	""",""".join(__a       )       ,	sep=""" | """       ,	)

		return int(stack[0]       )


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










class     A     :
			'''simple docstring'''




			def __init__(     self  :       Optional[int]  )      ->      Dict:







					"""simple docstring"""






					A__     =  {}






			def   a_			(     self  :       Any  )      ->      None:







					"""simple docstring"""






					print(self.vertex  )
					for i in self.vertex:
							print(__lowerCAmelCase				,      """ -> """				,      """ -> """.join([str(__lowerCAmelCase  ) for j in self.vertex[i]]  )  )






			def   a_			(     self  :       Optional[int]				,      __lowerCAmelCase  :       int				,      __lowerCAmelCase  :       int  )      ->      None:







					"""simple docstring"""






					if from_vertex in self.vertex:
							self.vertex[from_vertex].append(__lowerCAmelCase  )
					else:
							# else make a new vertex
							A__     =  [to_vertex]






			def   a_			(     self  :       List[str]  )      ->      None:







					"""simple docstring"""






					A__     =  [False] * len(self.vertex  )

					# call the recursive helper function
					for i in range(len(self.vertex  )  ):
							if not visited[i]:
									self.dfs_recursive(__lowerCAmelCase				,      __lowerCAmelCase  )







			def   a_			(     self  :       List[str]				,      __lowerCAmelCase  :       int				,      __lowerCAmelCase  :       list  )      ->      None:







					"""simple docstring"""






					A__     =  True

					print(__lowerCAmelCase				,      end=""" """  )

					# Recur for all the vertices that are adjacent to this node
					for i in self.vertex:
							if not visited[i]:
									self.dfs_recursive(__lowerCAmelCase				,      __lowerCAmelCase  )


if __name__ == "__main__":
					A       :   Tuple					= Graph()
					g.add_edge(0, 1)
					g.add_edge(0, 2)
					g.add_edge(1, 2)
					g.add_edge(2, 0)
					g.add_edge(2, 3)
					g.add_edge(3, 3)

					g.print_graph()
					print('''DFS:''')
					g.dfs()

					# OUTPUT:
					# 0  ->  1 -> 2
					# 1  ->  2
					# 2  ->  0 -> 3
					# 3  ->  3
					# DFS:
					#  0 1 2 3



