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