#00040F

Kvadrat

Magic square consists of 3x3 smaller squares, each containing a positive integer less than or equal to 20,000. It has a property that the sums of the numbers in each row, column and both diagonals are all equal. Dave had one beautiful magic square, but someone took a few (at most 3) numbers out of it.
Write a program that will, for a given magic square with some missing numbers, determine the numbers missing.


InputEach of the three lines of input contains three numbers i.e. description of the magic square. Squares with missing numbers are denoted with number 0.

OutputThree lines of output should contain the correctly filled magic square.

Input
4 9 2
3 0 7
8 1 6

Output
4 9 2
3 5 7
8 1 6

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.