Boring C++ mutex solution
\nclass Foo {\n    mutex m1;\n    mutex m2;\npublic:\n    Foo() {\n        m1.lock();\n        m2.lock();\n    }\n\n    void first(function<void()> printFirst) 
```\nclass Foo {\n    mutex m1;\n    mutex m2;\npublic:\n    Foo() {\n        m1.lock();\n        m2.lock();\n    }\n\n    void first(function<void()> printFirst) {\n        \n        // printFirst() outputs "first". Do not change or remove this line.\n        printFirst();\n        m1.unlock();\n    }\n\n    void second(function<void()> printSecond) {\n        m1.lock();\n        // printSecond() outputs "second". Do not change or remove this line.\n        printSecond();\n        m1.unlock();\n        m2.unlock();\n    }\n\n    void third(function<void()> printThird) {\n        m2.lock();\n        // printThird() outputs "third". Do not change or remove this line.\n        printThird();\n        m2.unlock();\n    }\n};\n```
['C']