class CQueue {
private:
stack<int> a, b;
public:
CQueue() {
// stack<int> a, b;
}
void appendTail(int value) {
a.push(value);
}
int deleteHead() {
if( a.empty() )return -1;
while( !a.empty() ){
int c = a.top();
a.pop();
b.push(c);
}
int res = b.top();
b.pop();
while( !b.empty() ){
int c = b.top();
b.pop();
a.push(c);
}
return res;
}
};
/**
* Your CQueue object will be instantiated and called as such:
* CQueue* obj = new CQueue();
* obj->appendTail(value);
* int param_2 = obj->deleteHead();
*/