6. Write a program to implement input-restricted deque. (Both the operations i.e., insertions and deletions should be taken care of.)