[C++][44ms] Using two deque (faster than 100%)
\nclass FrontMiddleBackQueue {\n    deque<int> q1,q2;\n    //balance two deque if size difference is greater than 1\n    void balanceQueue(){\n        int diff 
```\nclass FrontMiddleBackQueue {\n    deque<int> q1,q2;\n    //balance two deque if size difference is greater than 1\n    void balanceQueue(){\n        int diff = q1.size() - q2.size();\n        diff = abs(diff);\n        if(diff > 1){\n            if(q1.size() > q2.size()){\n                while(--diff){\n                    q2.push_front(q1.back());\n                    q1.pop_back();\n                }\n            }\n            else{\n                while(--diff){\n                    q1.push_back(q2.front());\n                    q2.pop_front();\n                }\n            }\n        }\n    }\npublic:\n    \n    void pushFront(int val) {\n        q1.push_front(val);\n        balanceQueue();\n    }\n    \n    void pushMiddle(int val) {\n        if(q1.size() > q2.size()){\n            q2.push_front(q1.back());\n            q1.pop_back();\n        }\n        q1.push_back(val);\n    }\n    \n    void pushBack(int val) {\n        q2.push_back(val);\n        balanceQueue();\n    }\n    \n    int popFront() {\n        int t;\n        if(q1.empty() && q2.empty())\n            return -1;\n        \n        if(!q1.empty()) {\n            t = q1.front();\n            q1.pop_front();\n        }\n        else {\n            t = q2.front();\n            q2.pop_front();\n        }\n        balanceQueue();\n        return t;\n    }\n    \n    int popMiddle() {\n        if(q1.empty() && q2.empty())\n            return -1;\n        int t;\n        if(q1.size() >= q2.size()){\n            t = q1.back();\n            q1.pop_back();\n        }\n        else{\n            t = q2.front();\n            q2.pop_front();\n        }\n        return t;\n    }\n    \n    int popBack() {\n        if(q1.empty() && q2.empty())\n            return -1;\n        int t;\n        if(!q2.empty()) {\n            t = q2.back();\n            q2.pop_back();\n        }\n        else {\n            t = q1.back();\n            q1.pop_back();\n        }\n        balanceQueue();\n        return t; \n    }\n};\n```
['Queue', 'C']