[Python] Simple solution using semaphores
python\nimport threading\n\nclass ZeroEvenOdd:\n    def __init__(self, n):\n        self.n = n\n        self.sz = threading.Semaphore(1)\n        self.se = thre
```python\nimport threading\n\nclass ZeroEvenOdd:\n    def __init__(self, n):\n        self.n = n\n        self.sz = threading.Semaphore(1)\n        self.se = threading.Semaphore(0)\n        self.so = threading.Semaphore(0)\n\n    def zero(self, printNumber: \'Callable[[int], None]\') -> None:\n        for i in range(1, self.n+1):\n            self.sz.acquire()\n            printNumber(0)\n\n            if i % 2 == 0:\n                self.se.release()\n            else:\n                self.so.release()\n\n    def even(self, printNumber: \'Callable[[int], None]\') -> None:\n        for i in range(2, self.n+1, 2):\n            self.se.acquire()\n            printNumber(i)\n            self.sz.release()\n\n    def odd(self, printNumber: \'Callable[[int], None]\') -> None:\n        for i in range(1, self.n+1, 2):\n            self.so.acquire()\n            printNumber(i)\n            self.sz.release()\n```
[]