Playing with stacks and queues