DEQUE You must simulate the operation of a doubly-ended queue. The queue stores a sequence of integers. You can enqueue and dequeue elements at either end of the list. You may assume that the number of elements in the queue at any time will never exceed 99, and that one never dequeues an element from an empty queue. Input: There will be multiple problem instances. Each instance contains a sequence of commands followed by the letter Q, which indicates the end of the instance. The four types of commands are E L n (Enqueue integer n at the left end of the list) E R n (Enqueue integer n at the right end of the list) D L (Dequeue an element from the left end of the list) D R (Dequeue an element from the right end of the list) The last line of the input contains only the letter X. Output: Each instance should generate a line of output. The line should list the integers in the queue at the end of the sequence of operations (from left to right). The integers should be separated by spaces. Sample Input (with 2 instances): E L 7 E R 6 E L 89 D R Q E R 1 E R 2 E R 3 E R 4 D L D L E L 5 Q X Sample Output: 89 7 5 3 4