import java.util.Stack;

class MyQueue {

static Stack<Integer> left = new Stack<Integer>();

static Stack<Integer> right = new Stack<Integer>();

```
// Push element x to the back of queue.
public void push(int x) {
left.push(x);
}
// Removes the element from in front of queue.
public void pop() {
while(left.size()!=1){
right.push(left.pop());
}
left.pop();
while(right.size()!=0){
left.push(right.pop());
}
}
// Get the front element.
public int peek() {
int peekElement;
while(left.size()!=1){
right.push(left.pop());
}
peekElement= left.peek();
right.push(left.pop());
while(right.size()!=0){
left.push(right.pop());
}
return peekElement;
}
// Return whether the queue is empty.
public boolean empty() {
return left.isEmpty();
}
```

}