


import operator as op


def 			UpperCAmelCase_				(      UpperCAmelCase__  ):
     lowercase_  							=			[]
     lowercase_  							=			lambda UpperCAmelCase__						,							UpperCAmelCase__  : int(x / y  )  # noqa: E731 integer division operation
     lowercase_  							=			{
         "^": 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(_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(1_2  )						,							""",""".join(_lowerCamelCase  )						,							sep=""" | """  )
          else:
               lowercase_  							=			stack.pop()  # pop stack
               # output in tabular format
               print("""""".rjust(8  )						,							("""pop(""" + b + """)""").ljust(1_2  )						,							""",""".join(_lowerCamelCase  )						,							sep=""" | """  )

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

     return int(stack[0]  )


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






from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

a					  =     TypeVar('T')







class        UpperCamelCase__   (	Generic[T]   ):
					__SCREAMING_SNAKE_CASE       :  deque[T]  # Cache store of keys
					__SCREAMING_SNAKE_CASE       :  set[T]  # References of the keys in cache
					__SCREAMING_SNAKE_CASE       :  int						=   10  # Maximum capacity of cache

					def __init__(     self       :   str							,					UpperCamelCase__       :   int       ):






										'''simple docstring'''






										lowercase_  							=			deque()
										lowercase_  							=			set()
										if not n:
															lowercase_  							=			sys.maxsize
										elif n < 0:
															raise ValueError("""n should be an integer greater than 0."""       )
										else:
															lowercase_  							=			n

					def   UpperCAmelCase__       (     self       :   Optional[int]							,					UpperCamelCase__       :   T       ):






										'''simple docstring'''






										if x not in self.key_reference:
															if len(self.dq_store       ) == LRUCache._MAX_CAPACITY:
																				lowercase_  							=			self.dq_store.pop()
																				self.key_reference.remove(UpperCamelCase__       )
										else:
															self.dq_store.remove(UpperCamelCase__       )

										self.dq_store.appendleft(UpperCamelCase__       )
										self.key_reference.add(UpperCamelCase__       )

					def   UpperCAmelCase__       (     self       :   List[Any]       ):






										'''simple docstring'''






										for k in self.dq_store:
															print(UpperCamelCase__       )







					def __repr__(     self       :   Optional[Any]       ):






										'''simple docstring'''






										return F'''LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store       )}'''


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							a					  =     LRUCache(4)
							lru_cache.refer('A')
							lru_cache.refer(2)
							lru_cache.refer(3)
							lru_cache.refer('A')
							lru_cache.refer(4)
							lru_cache.refer(5)
							lru_cache.display()

							print(lru_cache)
							assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"


