SP13980 SUDOGOB - Sudoku goblin

Description

A sudoku goblin has read your book with sudoku problems. He has erased or added some numbers from settings. Your task is to write a program that can detect modified settings. For every sudoku setting you have to count number of possible solutions and in the case that it is equal to 1 print the unique solution.

Input Format

There is a number T of the test cases on the first line folowed by T sudoku tables separated by one empty line. One sudoku table consists of 9 lines of 9 numbers 0-9 separated by one space. Zero in the table marks the empty field.

Output Format

For every test case, one line with number of possible solutions optionally followed by solved sudoku in the same format as on the input.