Eight Puzzle Problem In Python