classMyQueue{public:/** Initialize your data structure here. */MyQueue(){}/** Push element x to the back of queue. */voidpush(int x){left.push(x);}/** Removes the element from in front of queue and returns that element. */intpop(){if(right.empty()){while(!left.empty()){int top = left.top();left.pop();right.push(top);}}int top = right.top();right.pop();return top;}/** Get the front element. */intpeek(){if(right.empty()){while(!left.empty()){int top = left.top();left.pop();right.push(top);}}int top = right.top();return top;}/** Returns whether the queue is empty. */boolempty(){return left.empty()&& right.empty();}stack<int>left;stack<int>right;};/*** Your MyQueue object will be instantiated and called as such:* MyQueue* obj = new MyQueue();* obj->push(x);* int param_2 = obj->pop();* int param_3 = obj->peek();* bool param_4 = obj->empty();*/