
import operator as op

def  __lowerCamelCase					( _lowercase			)       ->      Optional[int]:
     UpperCamelCase						    =					[]
     UpperCamelCase						    =					lambda _lowercase						,     _lowercase			: int(x / y			)  # noqa: E731 integer division operation
     UpperCamelCase						    =					{
         '^': 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						    =					stack.pop()  # pop stack
               # output in tabular format
               print(''.rjust(8			)						,     ('pop(' + b + ')').ljust(12			)						,     ','.join(_lowercase			)						,     sep=' | '			)

               UpperCamelCase						    =					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__":
 _snake_case      = input('''\n\nEnter a Postfix Equation (space separated) = ''').split(''' ''')
 print('''\n\tResult = ''', solve(Postfix))




from __future__ import annotations

from collections import Counter
from random import random
class       _lowerCAmelCase  :

 """simple docstring"""

 def __init__(						self			:			Union[str, Any]   ):






      """simple docstring"""



      UpperCamelCase						    =					{}

 def      __lowerCAmelCase  (						self			:			Tuple					, SCREAMING_SNAKE_CASE__			:			str   ):






      """simple docstring"""



      UpperCamelCase						    =					{}

 def      __lowerCAmelCase  (						self			:			Optional[Any]					, SCREAMING_SNAKE_CASE__			:			str					, SCREAMING_SNAKE_CASE__			:			str					, SCREAMING_SNAKE_CASE__			:			float   ):






      """simple docstring"""



      if nodea not in self.connections:
           self.add_node(SCREAMING_SNAKE_CASE__   )
      if nodea not in self.connections:
           self.add_node(SCREAMING_SNAKE_CASE__   )
      UpperCamelCase						    =					probability

 def      __lowerCAmelCase  (						self			:			str   ):






      """simple docstring"""



      return list(self.connections   )






 def      __lowerCAmelCase  (						self			:			Any					, SCREAMING_SNAKE_CASE__			:			str   ):






      """simple docstring"""



      UpperCamelCase						    =					0
      UpperCamelCase						    =					random()

      for dest in self.connections[node]:
           current_probability += self.connections[node][dest]
           if current_probability > random_value:
                return dest
      return ""




def  __lowerCamelCase					( _lowercase						,     _lowercase						,     _lowercase			)       ->      dict[str, int]:
     UpperCamelCase						    =					MarkovChainGraphUndirectedUnweighted()

     for nodea, nodea, probability in transitions:
          graph.add_transition_probability(_lowercase						,     _lowercase						,     _lowercase			)

     UpperCamelCase						    =					Counter(graph.get_nodes()			)
     UpperCamelCase						    =					start

     for _ in range(_lowercase			):
          UpperCamelCase						    =					graph.transition(_lowercase			)
          visited[node] += 1

     return visited


if __name__ == "__main__":
 import doctest

 doctest.testmod()


