eolymp
bolt
Try our new interface for solving problems

Aaa

This and all following tasks are devoted to stories about a girl who has played an important role in the lives of the authors. It all began like this: During one of hundreds of absolutely unimportant lectures, senior student was evenly distributing Sudoku puzzles around herself. Sasha was also given one, and that was a preposition to speak. --- \textit{I hope this is the most difficult level}? --- \textit{Just for you}. --- \textit{Well, well}, --- seeing a deep irony in her eyes and the fact that the first three lines are already filled. --- \textit{If you solve this one, I'll give you another}. --- \textit{I won't just solve this, but I will say how many solutions exist}, --- said Sasha boastfully, not knowing what a problem he has created for himself. --- \textit{Well, well, we'll see}. The next two days Sasha was engaged only in looking for number of solutions for sudoku. By the way, sudoku is a puzzle in which it is proposed to fill a \textbf{9}×\textbf{9} table with numbers from \textbf{1} to \textbf{9} so that in every row, column and each of the \textbf{9} squares \textbf{3}×\textbf{3}, all the numbers were different. Initially, some cells are already filled and you are to write the numbers in empty cells. --- \textit{And what was the girl's name, again}? --- \textit{Oh}... \InputFile There are \textbf{3} lines, consisting of \textbf{9} integers from \textbf{1} to \textbf{9} in each. Those are first three lines of Sudoku. \OutputFile The only number: number of solutions. It is guaranteed that at least one solution exists.
Time limit 1 second
Memory limit 64 MiB