

# This code is adapted from OpenAI's release
# https://github.com/openai/human-eval/blob/master/human_eval/execution.py

import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile





def a(lowercase__			, lowercase__			, lowercase__			, lowercase__	):





	'''simple docstring'''
	snake_case_      		= multiprocessing.Manager()
	snake_case_      		= manager.list()

	snake_case_      		= multiprocessing.Process(target=lowercase__			, args=(check_program, result, timeout)	)
	p.start()
	p.join(timeout=timeout + 1	)
	if p.is_alive():
		p.kill()

	if not result:
		result.append('timed out'	)

	return {
	    "task_id": task_id,
	    "passed": result[0] == "passed",
	    "result": result[0],
	    "completion_id": completion_id,
	}





def a(lowercase__			, lowercase__			, lowercase__	):





	'''simple docstring'''
	with create_tempdir():
		# These system calls are needed when cleaning up tempdir.
		import os
		import shutil

		snake_case_      		= shutil.rmtree
		snake_case_      		= os.rmdir
		snake_case_      		= os.chdir

		# Disable functionalities that can make destructive changes to the test.
		reliability_guard()

		# Run program.
		try:
			snake_case_      		= {}
			with swallow_io():
				with time_limit(lowercase__	):
					exec(lowercase__			, lowercase__	)
			result.append('passed'	)
		except TimeoutException:
			result.append('timed out'	)
		except BaseException as e:
			result.append(f"""failed: {e}"""	)

		# Needed for cleaning up.
		snake_case_      		= rmtree
		snake_case_      		= rmdir
		snake_case_      		= chdir





@contextlib.contextmanager
def a(lowercase__	):





	'''simple docstring'''
	def signal_handler(lowercase__			, lowercase__	):
		raise TimeoutException('Timed out!'	)

	signal.setitimer(signal.ITIMER_REAL			, lowercase__	)
	signal.signal(signal.SIGALRM			, lowercase__	)
	try:
		yield
	finally:
		signal.setitimer(signal.ITIMER_REAL			, 0	)





@contextlib.contextmanager
def a():





	'''simple docstring'''
	snake_case_      		= WriteOnlyStringIO()
	with contextlib.redirect_stdout(lowercase__	):
		with contextlib.redirect_stderr(lowercase__	):
			with redirect_stdin(lowercase__	):
				yield





@contextlib.contextmanager
def a():





	'''simple docstring'''
	with tempfile.TemporaryDirectory() as dirname:
		with chdir(lowercase__	):
			yield dirname


class SCREAMING_SNAKE_CASE  (		__snake_case							):






			"""simple docstring"""




			pass







class SCREAMING_SNAKE_CASE  (		io.StringIO							):






			"""simple docstring"""




			def 			__lowerCAmelCase (    self ,				*__UpperCamelCase ,				**__UpperCamelCase							):

				"""simple docstring"""


				raise OSError


			def 			__lowerCAmelCase (    self ,				*__UpperCamelCase ,				**__UpperCamelCase							):

				"""simple docstring"""


				raise OSError


			def 			__lowerCAmelCase (    self ,				*__UpperCamelCase ,				**__UpperCamelCase							):

				"""simple docstring"""


				raise OSError







			def 			__lowerCAmelCase (    self ,				*__UpperCamelCase ,				**__UpperCamelCase							):

				"""simple docstring"""


				return False







class SCREAMING_SNAKE_CASE  (		contextlib._RedirectStream							):  # type: ignore






			"""simple docstring"""




			__A						  =  """stdin"""







@contextlib.contextmanager
def a(lowercase__	):





	'''simple docstring'''
	if root == ".":
		yield
		return
	snake_case_      		= os.getcwd()
	os.chdir(lowercase__	)
	try:
		yield
	except BaseException as exc:
		raise exc
	finally:
		os.chdir(lowercase__	)






def a(lowercase__=None	):





	'''simple docstring'''

	if maximum_memory_bytes is not None:
		import resource

		resource.setrlimit(resource.RLIMIT_AS			, (maximum_memory_bytes, maximum_memory_bytes)	)
		resource.setrlimit(resource.RLIMIT_DATA			, (maximum_memory_bytes, maximum_memory_bytes)	)
		if not platform.uname().system == "Darwin":
			resource.setrlimit(resource.RLIMIT_STACK			, (maximum_memory_bytes, maximum_memory_bytes)	)

	faulthandler.disable()

	import builtins

	snake_case_      		= None
	snake_case_      		= None

	import os

	snake_case_      		= '1'

	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None

	import shutil

	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None

	import subprocess

	snake_case_      		= None  # type: ignore

	snake_case_      		= None

	import sys

	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None
	snake_case_      		= None



import operator as op





def a(lowercase__	):





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

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