simplest solution
No fancy multiple threading blablalba\n\npublic class Foo {\n\n    int count;\n    public Foo() {\n        count = 0;\n    }\n\n    public void First(Action pri
No fancy multiple threading blablalba\n```\npublic class Foo {\n\n    int count;\n    public Foo() {\n        count = 0;\n    }\n\n    public void First(Action printFirst) {\n        // printFirst() outputs "first". Do not change or remove this line.\n        printFirst();\n        count++;\n    }\n\n    public void Second(Action printSecond) {\n        // printSecond() outputs "second". Do not change or remove this line.\n        while(count < 1) continue;\n        printSecond();\n        count++;\n    }\n\n    public void Third(Action printThird) {\n        while(count < 2) continue;\n        // printThird() outputs "third". Do not change or remove this line.\n        printThird();\n    }\n}\n```
[]