






'''simple docstring'''
import operator as op




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   lowercase_	:    Optional[Any]           =     []
   lowercase_	:    List[Any]           =     lambda _UpperCamelCase						,		_UpperCamelCase							: int(x / y							)  # noqa: E731 integer division operation
   lowercase_	:    List[str]           =     {
       "^": 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:
         lowercase_	:    Dict           =     stack.pop()  # pop stack
         # output in tabular format
         print("".rjust(8							)						,		("pop(" + b + ")").ljust(12							)						,		",".join(_UpperCamelCase							)						,		sep=" | "							)

         lowercase_	:    Optional[int]           =     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__":
 UpperCamelCase__ =			input('\n\nEnter a Postfix Equation (space separated) = ').split(' ')
 print('\n\tResult = ', solve(Postfix))












'''simple docstring'''
def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   return [
       {
           0: [1, 2],
           1: [0, 2],
           2: [0, 1, 3, 5],
           3: [2, 4],
           4: [3],
           5: [2, 6, 8],
           6: [5, 7],
           7: [6, 8],
           8: [5, 7],
       },
       {
           0: [6],
           1: [9],
           2: [4, 5],
           3: [4],
           4: [2, 3],
           5: [2],
           6: [0, 7],
           7: [6],
           8: [],
           9: [1],
       },
       {
           0: [4],
           1: [6],
           2: [],
           3: [5, 6, 7],
           4: [0, 6],
           5: [3, 8, 9],
           6: [1, 3, 4, 7],
           7: [3, 6, 8, 9],
           8: [5, 7],
           9: [5, 7],
       },
       {
           0: [1, 3],
           1: [0, 2, 4],
           2: [1, 3, 4],
           3: [0, 2, 4],
           4: [1, 2, 3],
       },
   ][index]




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   lowercase_	:    Dict           =     0
   lowercase_	:    Optional[Any]           =     len(_UpperCamelCase							)  # No of vertices in graph
   lowercase_	:    Union[str, Any]           =     [0] * n
   lowercase_	:    Optional[int]           =     [False] * n

   def dfs(_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase							):
      lowercase_	:    Union[str, Any]           =     True
      lowercase_	:    Dict           =     id_
      id_ += 1
      for to in graph[at]:
         if to == parent:
            pass
         elif not visited[to]:
            dfs(_UpperCamelCase						,		_UpperCamelCase						,		_UpperCamelCase						,		id_							)
            lowercase_	:    str           =     min(low[at]						,		low[to]							)
            if id_ <= low[to]:
               bridges.append((at, to) if at < to else (to, at)							)
         else:
            # This edge is a back edge and cannot be a bridge
            lowercase_	:    Optional[int]           =     min(low[at]						,		low[to]							)

   lowercase_	:    list[tuple[int, int]]           =     []
   for i in range(_UpperCamelCase							):
      if not visited[i]:
         dfs(_UpperCamelCase						,		-1						,		_UpperCamelCase						,		id_							)
   return bridges


if __name__ == "__main__":
 import doctest

 doctest.testmod()




