Wrtie a code for queues using stack
You can implement a queue using two stacks like this:
```python
class Queue:
    def init(self):
        self.in_stack = []
        self.out_stack = []

    def enqueue(self, item):
        self.in_stack.append(item)

    def dequeue(self):
        if not self.out_stack:
            while self.in_stack:
                self.out_stack.append(self.in_stack.pop())
        return self.out_stack.pop()
```

The key insight here is that stacking and unstacking on a stack is an O(1) operation, but the order is reversed.
So we use the in_stack to truly enqueue items, but then we transfer all the items to the out_stack for dequeuing, so that the order is preserved.
This leads to an overall enqueue time of O(1) and dequeue time of O(N) in the worst case (when the out_stack is empty). For more balanced usage the amortized time will be closer to O(1).
What would be a better implementation for a queue, which has better performance than using stacks?