Python solution to the 15-puzzle problem.