2-Lines Python Solution || 75% Faster || Memory less than 95%
\nclass Foo:\n    is_first_executed=False\n    is_second_executed=False\n    def __init__(self):\n        pass\n\n    def first(self, printFirst):\n        prin
```\nclass Foo:\n    is_first_executed=False\n    is_second_executed=False\n    def __init__(self):\n        pass\n\n    def first(self, printFirst):\n        printFirst()\n        self.is_first_executed=True\n\n    def second(self, printSecond):\n        while not self.is_first_executed: continue     \n        printSecond()\n        self.is_second_executed=True\n                      \n    def third(self, printThird):\n        while not self.is_second_executed: continue\n        printThird()\n```\n\n-----------------\n### ***Another Solution***\n```\nfrom threading import Event\nclass Foo:\n    def __init__(self):\n        self.event1=Event()\n        self.event2=Event()\n\n    def first(self, printFirst: \'Callable[[], None]\') -> None:\n        printFirst()\n        self.event1.set()\n\n    def second(self, printSecond: \'Callable[[], None]\') -> None:\n        self.event1.wait()\n        printSecond()\n        self.event2.set()\n\n    def third(self, printThird: \'Callable[[], None]\') -> None:\n        self.event2.wait()\n        printThird()\n```\n-------------------\n***----- Taha Choura -----***\n*taha.choura@outlook.com*
['Python', 'Python3']