class CQueue {
Stack<Integer> A;
Stack<Integer> B;
public CQueue() {
A =new Stack<>();
B =new Stack<>();
}
public void appendTail(int value) {
A.add(value);
}
public int deleteHead() {
if(!B.isEmpty()){
return B.pop();
}else{
while(!A.isEmpty()){
B.push(A.pop());
}
}
return B.isEmpty()? -1:B.pop();
}
}
/**
* Your CQueue object will be instantiated and called as such:
* CQueue obj = new CQueue();
* obj.appendTail(value);
* int param_2 = obj.deleteHead();
*/