Simple solution in C
\ntypedef struct {\n    int n;\n    pthread_mutex_t zeroLock;\n    pthread_mutex_t evenLock;\n    pthread_mutex_t oddLock;\n    \n} ZeroEvenOdd;\n\nZeroEvenOdd*
```\ntypedef struct {\n    int n;\n    pthread_mutex_t zeroLock;\n    pthread_mutex_t evenLock;\n    pthread_mutex_t oddLock;\n    \n} ZeroEvenOdd;\n\nZeroEvenOdd* zeroEvenOddCreate(int n) {\n    ZeroEvenOdd* obj = (ZeroEvenOdd*) malloc(sizeof(ZeroEvenOdd));\n    obj->n = n;\n    pthread_mutex_init(&obj->zeroLock, NULL);\n    pthread_mutex_init(&obj->evenLock, NULL);\n    pthread_mutex_init(&obj->oddLock, NULL);\n    pthread_mutex_lock(&obj->evenLock);\n    pthread_mutex_lock(&obj->oddLock);\n    return obj;\n}\n\n// You may call global function `void printNumber(int x)`\n// to output "x", where x is an integer.\n\nvoid zero(ZeroEvenOdd* obj) {\n    for (int i = 1; i <= obj->n; i++){\n        pthread_mutex_lock(&obj->zeroLock);\n        printNumber(0);    \n        if( i % 2 == 0){\n            pthread_mutex_unlock(&obj->evenLock);\n        }else{\n            pthread_mutex_unlock(&obj->oddLock);\n        }\n    }\n}\n\nvoid even(ZeroEvenOdd* obj) {\n    for (int i = 2; i <= obj->n; i+=2){\n        pthread_mutex_lock(&obj->evenLock);\n        printNumber(i);\n        pthread_mutex_unlock(&obj->zeroLock);\n    }\n}\n\nvoid odd(ZeroEvenOdd* obj) {\n    for (int i = 1; i <= obj->n; i+=2){\n        pthread_mutex_lock(&obj->oddLock);\n        printNumber(i);\n        pthread_mutex_unlock(&obj->zeroLock); \n    }\n}\n\nvoid zeroEvenOddFree(ZeroEvenOdd* obj) {\n    pthread_mutex_destroy(&obj->zeroLock);\n    pthread_mutex_destroy(&obj->evenLock);\n    pthread_mutex_destroy(&obj->oddLock);\n}\n```
['C']