class GameStack:
	def __init__(self):
		self.gamestack = []

	def push(self, func, args):
		self.gamestack.append((func, args))

	def pop(self):
		self.gamestack.pop()

	def pushpop(self, func, args):
		self.gamestack.pop()
		self.gamestack.append((func, args))

	def run(self):
		while len(self.gamestack) > 0:
			(func, args) = self.gamestack[-1]
			func(*args)
