Frame-Stewart's Hanoi tower algorithm implementation.