design queue support push pop operation middle backImplement FrontMiddleBack classfrontmiddleback Initializes queuevoid pushfrontint val add val queuevoid pushmiddleint val add val middle queuevoid pushbackint val add val queueint popfront remove element queue return if queue return 1int popmiddle Removes middle element queue return if queue return 1int popback Removes element queue return if queue return 1notice middle position choice operation perform frontmost middle position choice for examplepushe 6 middle 1 2 3 4 5 result 1 2 6 3 4 5popping middle 1 2 3 4 5 6 return 3 result 1 2 4 5 6 Example 1inputfrontmiddlebackqueue pushfront pushback pushmiddle pushmiddle popFront popmiddle popmiddle popback popfront 1 2 3 4 outputnull null null null null 1 3 4 2 1explanationfrontmiddlebackqueue q new FrontMiddleBackQueueqpushFront1 1qpushback2 1 2qpushmiddle3 1 3 2qpushmiddle4 1 4 3 2qpopfront return 1 4 3 2qpopmiddle return 3 4 2qpopmiddle return 4 2qpopback return 2 qpopfront return 1 the queue Constraints1 val 109At 1000 call pushfront pushmiddle pushback popfront popmiddle popback