Tower of Hanoi solver