Python solution without using additional libraries
\nclass Foo:\n    def __init__(self):\n        self._first = False\n        self._second = False\n\n\n    def first(self, printFirst: \'Callable[[], None]\') ->
```\nclass Foo:\n    def __init__(self):\n        self._first = False\n        self._second = False\n\n\n    def first(self, printFirst: \'Callable[[], None]\') -> None:\n        \n        # printFirst() outputs "first". Do not change or remove this line.\n        printFirst()\n        self._first = True\n\n\n    def second(self, printSecond: \'Callable[[], None]\') -> None:\n        while not self._first:\n            pass\n        \n        # printSecond() outputs "second". Do not change or remove this line.\n        printSecond()\n        self._second = True\n\n\n    def third(self, printThird: \'Callable[[], None]\') -> None:\n        while not self._second:\n            pass\n        # printThird() outputs "third". Do not change or remove this line.\n        printThird()\n```
[]