class MyQueue {
private:
stack<int> a;
stack<int> b;
public:
/** Initialize your data structure here. */
MyQueue():a(),b() {
}
/** Push element x to the back of queue. */
void push(int x) {
a.push(x);
}
/** Removes the element from in front of queue and returns that element. */
int pop() {
if(b.empty()){
while(!a.empty()){
b.push(a.top());
a.pop();
}
}
int temp=b.top();
b.pop();
return temp;
}
/** Get the front element. */
int peek() {
if(b.empty()){
while(!a.empty()){
b.push(a.top());
a.pop();
}
}
return b.top();
}
/** Returns whether the queue is empty. */
bool empty() {
return b.empty() && a.empty()