Valid Moves in Towers of Hanoi Using Stacks