Accepted C# using AutoResetEvent
\nusing System.Threading;    \n\npublic class Foo\n    {\n        private EventWaitHandle _waitFirst;\n        private EventWaitHandle _waitSecond;\n\n        p
```\nusing System.Threading;    \n\npublic class Foo\n    {\n        private EventWaitHandle _waitFirst;\n        private EventWaitHandle _waitSecond;\n\n        public Foo()\n        {\n            _waitFirst = new AutoResetEvent(false);\n            _waitSecond = new AutoResetEvent(false);\n        }\n\n        public void First(Action printFirst)\n        {\n\n            // printFirst() outputs "first". Do not change or remove this line.\n            printFirst();\n            _waitFirst.Set();\n        }\n\n        public void Second(Action printSecond)\n        {\n            _waitFirst.WaitOne();\n            // printSecond() outputs "second". Do not change or remove this line.\n            printSecond();\n            _waitSecond.Set();\n        }\n\n        public void Third(Action printThird)\n        {\n            _waitSecond.WaitOne();\n            // printThird() outputs "third". Do not change or remove this line.\n            printThird();\n        }\n    }\n```
[]