Implement Tower of Hanoi by A* algorithm