By now, everyone has played Sudoku: you're given a 9-by-9 grid of boxes which you are to fill in with the digits 1 through 9 so that 1) every row has all nine digits, 2) every column has all nine digits, and 3) all nine 3-by-3 subgrids have all nine digits. To start the game you are given a partially completed grid and are asked to fill in the remainder of the boxes. One such puzzle is shown below.
In this problem, you will be given Sudoku grids which you have nearly completed; indeed you've filled in every box except five. You are asked to complete the grid, or determine that it's impossible. (You might have already made an error!)