





'''simple docstring'''


import operator as op
def 							UpperCAmelCase_  (						__lowerCamelCase : List[str]			):
   lowercase_      :int         =			[]
   lowercase_      :Dict         =			lambda __lowerCamelCase     ,__lowerCamelCase			: int(x / y			)  # noqa: E731 integer division operation
   lowercase_      :Optional[int]         =			{
       "^": 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(__lowerCamelCase			))			)

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

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

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

   return int(stack[0]			)


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









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase : dict			):
   lowercase_      :set[int]         =			set()
   # To detect a back edge, keep track of vertices currently in the recursion stack
   lowercase_      :set[int]         =			set()
   return any(
       node not in visited and depth_first_search(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			)
       for node in graph			)
def 							UpperCAmelCase_  (						__lowerCamelCase : dict     ,__lowerCamelCase : int     ,__lowerCamelCase : set     ,__lowerCamelCase : set			):
   visited.add(__lowerCamelCase			)
   rec_stk.add(__lowerCamelCase			)

   for node in graph[vertex]:
      if node not in visited:
         if depth_first_search(__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase     ,__lowerCamelCase			):
            return True
      elif node in rec_stk:
         return True

    # The node needs to be removed from recursion stack before function ends
   rec_stk.remove(__lowerCamelCase			)
   return False


if __name__ == "__main__":
 from doctest import testmod

 testmod()


