Queue dentist = new Queue();
print(dentist.removeLast()); // Bar
print(dentist.removeLast()); // Foo
The same Queue class can be also used to implement a Stack. Apparently adding at both ends and removing from both ends of a Queue class is fast
and thus this class is optimal for both FIFO and LIFO data structures.