C# with List<T>, Beats 100%
Complexity
Time complexity: O(n)

Space complexity:O(n)
Code
# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(n)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```csharp []
public class FrontMiddleBackQueue
{
    private int _cnt;
    private List<int> _list;

    public FrontMiddleBackQueue()
    {
        this._cnt = 0;
        this._list = new List<int>();
    }

    public void PushFront(int val)
    {
        _list.Insert(0, val);
        _cnt++;
    }

    public void PushMiddle(int val)
    {

        _list.Insert(_cnt / 2, val);
        _cnt++;
    }

    public void PushBack(int val)
    {
        _list.Add(val);
        _cnt++;
    }

    public int PopFront()
    {
        if (_cnt == 0) return -1;

        var ans = _list[0];
        _list.RemoveAt(0);
        _cnt--;
        return ans;
    }

    public int PopMiddle()
    {
        if (_cnt == 0) return -1;

        var idx = -1;
        if (_cnt % 2 == 0)
        {
            idx = (_cnt / 2) - 1;
        }
        else
        {
            idx = _cnt / 2;
        }

        var ans = _list[idx];
        _list.RemoveAt(idx);
        _cnt--;
        return ans;
    }

    public int PopBack()
    {
        if (_cnt == 0) return -1;

        var ans = _list[_cnt - 1];
        _list.RemoveAt(_cnt - 1);
        _cnt--;
        return ans;
    }
}

/**
 * Your FrontMiddleBackQueue object will be instantiated and called as such:
 * FrontMiddleBackQueue obj = new FrontMiddleBackQueue();
 * obj.PushFront(val);
 * obj.PushMiddle(val);
 * obj.PushBack(val);
 * int param_4 = obj.PopFront();
 * int param_5 = obj.PopMiddle();
 * int param_6 = obj.PopBack();
 */
```
['C#']