The Tower of Hanoi exercise