Python - using events
\nclass Foo:\n    def __init__(self):\n        self.first_event = threading.Event()\n        self.second_event = threading.Event()\n       \n    def first(self,
```\nclass Foo:\n    def __init__(self):\n        self.first_event = threading.Event()\n        self.second_event = threading.Event()\n       \n    def first(self, printFirst: \'Callable[[], None]\') -> None:\n        # printFirst() outputs "first". Do not change or remove this line.\n        printFirst()\n        self.first_event.set()\n\n\n    def second(self, printSecond: \'Callable[[], None]\') -> None:\n        self.first_event.wait()\n        # printSecond() outputs "second". Do not change or remove this line.\n        printSecond()\n        self.second_event.set()\n            \n\n    def third(self, printThird: \'Callable[[], None]\') -> None:\n        self.second_event.wait()\n        # printThird() outputs "third". Do not change or remove this line.\n        printThird()\n```
['Python3']