Towers of Hanoi solver