C++ deque solution, concise
\nclass FrontMiddleBackQueue {\n    deque<int> dq;\npublic:\n    FrontMiddleBackQueue() {\n        dq.clear();\n    }\n    \n    void pushFront(int val) {\n    
```\nclass FrontMiddleBackQueue {\n    deque<int> dq;\npublic:\n    FrontMiddleBackQueue() {\n        dq.clear();\n    }\n    \n    void pushFront(int val) {\n        dq.push_front(val);\n    }\n    \n    void pushMiddle(int val) {\n        int n = dq.size();\n        dq.insert(dq.begin() + n / 2, val);\n    }\n    \n    void pushBack(int val) {\n        dq.push_back(val);\n    }\n    \n    int popFront() {\n        if(dq.empty()) return -1;\n        \n        int ans = dq.front();\n        dq.pop_front();\n        return ans;\n    }\n    \n    int popMiddle() {\n        if(dq.empty()) return -1;\n        \n        int mid = (dq.size() - 1) / 2;\n        int ans = *(dq.begin() + mid);\n        dq.erase(dq.begin() + mid);\n        return ans;\n    }\n    \n    int popBack() {\n        if(dq.empty()) return -1;\n        \n        int ans = dq.back();\n        dq.pop_back();\n        return ans;\n    }\n};\n```
[]