using vector(c++)
\nclass FrontMiddleBackQueue {\npublic:\n    // here i will go with a vector\n    vector<int>v;\n    \n    FrontMiddleBackQueue() {\n         \n    }\n    \n   
```\nclass FrontMiddleBackQueue {\npublic:\n    // here i will go with a vector\n    vector<int>v;\n    \n    FrontMiddleBackQueue() {\n         \n    }\n    \n    void pushFront(int val) {\n     v.insert(v.begin(),val);   \n    }\n    \n    void pushMiddle(int val) {\n        int mid=v.size()/2;\n        v.insert(v.begin()+mid,val);\n    }\n    \n    void pushBack(int val) {\n        v.push_back(val);\n    }\n    \n    int popFront() {\n        if(v.size()==0)\n            return -1;\n        int k= *v.begin();\n        v.erase(v.begin());\n        return k;\n        \n    }\n    \n    int popMiddle() {\n        if(v.size() == 0) return -1;\n\n        int mid = v.size() % 2 == 0 ? v.size()/2 - 1   : v.size()/2  ;\n        mid = max(mid,0);\n        int k =v[mid];\n        v.erase(v.begin() + mid );\n        return k;\n    }\n    \n    int popBack() {\n        if(v.size()==0)\n            return -1;\n        int k=v[v.size()-1];\n        v.pop_back();\n        return k;\n        \n    }\n};\n```
[]