Python Simple Working solution
python\nfrom threading import Lock\n\nclass Foo:\n    def __init__(self):\n        self.lock1 = Lock()\n        self.lock2 = Lock()\n        \n        self.lock
```python\nfrom threading import Lock\n\nclass Foo:\n    def __init__(self):\n        self.lock1 = Lock()\n        self.lock2 = Lock()\n        \n        self.lock1.acquire()\n        self.lock2.acquire()\n\n\n    def first(self, printFirst: \'Callable[[], None]\') -> None:\n        printFirst()\n        \n        self.lock1.release()\n\n\n    def second(self, printSecond: \'Callable[[], None]\') -> None:\n        self.lock1.acquire() # Wait unti first finishes\n        \n        printSecond()\n        \n        self.lock2.release()\n\n    def third(self, printThird: \'Callable[[], None]\') -> None:\n        self.lock2.acquire() # Wait unti second finishes\n        \n        printThird()\n```
[]