





"""simple docstring"""




import operator as op





def 	a_    (							_lowercase       ):
						_UpperCamelCase      : Union[str, Any]         =   []
						_UpperCamelCase      : Tuple         =   lambda _lowercase	,						_lowercase       : int(x / y       )  # noqa: E731 integer division operation
						_UpperCamelCase      : List[Any]         =   {
						    '''^''': 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(_lowercase       ))       )

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

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

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

						return int(stack[0]       )


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










"""simple docstring"""




class 			_a						:






				def __init__(			self		:   Optional[int],			lowerCAmelCase__		:   list							)     ->				None:




										'''simple docstring'''



										_UpperCamelCase      : Optional[int]         =   set_counts
										_UpperCamelCase      : Any         =   max(lowerCAmelCase__							)
										_UpperCamelCase      : int         =   len(lowerCAmelCase__							)
										_UpperCamelCase      : int         =   [1] * num_sets
										_UpperCamelCase      : List[Any]         =   list(range(lowerCAmelCase__							)							)






				def     snake_case     (			self		:   int,			lowerCAmelCase__		:   int,			lowerCAmelCase__		:   int							)     ->				bool:




										'''simple docstring'''



										_UpperCamelCase      : Optional[Any]         =   self.get_parent(lowerCAmelCase__							)
										_UpperCamelCase      : Any         =   self.get_parent(lowerCAmelCase__							)

										if src_parent == dst_parent:
																return False

										if self.ranks[dst_parent] >= self.ranks[src_parent]:
																self.set_counts[dst_parent] += self.set_counts[src_parent]
																_UpperCamelCase      : List[Any]         =   0
																_UpperCamelCase      : str         =   dst_parent
																if self.ranks[dst_parent] == self.ranks[src_parent]:
																						self.ranks[dst_parent] += 1
																_UpperCamelCase      : Union[str, Any]         =   self.set_counts[dst_parent]
										else:
																self.set_counts[src_parent] += self.set_counts[dst_parent]
																_UpperCamelCase      : Tuple         =   0
																_UpperCamelCase      : Optional[Any]         =   src_parent
																_UpperCamelCase      : int         =   self.set_counts[src_parent]

										_UpperCamelCase      : Optional[Any]         =   max(self.max_set,			lowerCAmelCase__							)
										return True






				def     snake_case     (			self		:   Optional[Any],			lowerCAmelCase__		:   int							)     ->				int:




										'''simple docstring'''



										if self.parents[disj_set] == disj_set:
																return disj_set
										_UpperCamelCase      : Union[str, Any]         =   self.get_parent(self.parents[disj_set]							)
										return self.parents[disj_set]



