Sudoku (2)

This exercise has the same wording than the exercise P89454: Write a program that finds all the possible solutions of a sudoku.

Input

Input consists of 81 numbers between zero and nine, plus the bars and dashes that can be seen at the instances. The zeros indicate positions of unknown value. Except zeros, there will not be any repeated number in any row, nor any column, nor any of the nine squares 3×33 \times 3.

Output

Your program must print all the possible solutions of the given sudoku, each one with a line in white in the end. It must print "-1" if there is not any possible solution.

Observations

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-02-04T17:25:32.171Z

© Jutge.org, 2006–2026.
https://jutge.org