solve hanoi problem