hanoi, ttt, and snake