#GYM104755K. Quadroku

Quadroku

本题没有可用的提交语言。

Description

In this problem you need to solve the quadroku puzzle. In quadroku, you are given a $4 \times 4$ square grid with digits between $1$ to $4$ written in some of the squares. To solve it, you need to write digits in the empty squares so that the following conditions hold:

  • each row contains all the digits from $1$ to $4$;
  • each column contains all the digits from $1$ to $4$;
  • each $2 \times 2$ block with two sides on the sides of the grid contains all the digits from $1$ to $4$.

In this problem, you are initially given all digits in the upper left and lower right blocks such that each of those blocks contain all the digits from $1$ to $4$. Find the solution to the given quadroku or determine that it is impossible!

The four input lines contain four integers each, the description of the initial grid. The upper left and the lower right blocks each contain all the digits from $1$ to $4$. The digits in the upper right and lower left blocks will always be $0$ to denote that the squares are empty.

If there exists a solution, first output "Yes" in the first line. In the next four lines output four integers in each, the solution of the puzzle. It can be shown that if the solution exists, it is unique.

If there is no solution, simply output "No".

Input

The four input lines contain four integers each, the description of the initial grid. The upper left and the lower right blocks each contain all the digits from $1$ to $4$. The digits in the upper right and lower left blocks will always be $0$ to denote that the squares are empty.

Output

If there exists a solution, first output "Yes" in the first line. In the next four lines output four integers in each, the solution of the puzzle. It can be shown that if the solution exists, it is unique.

If there is no solution, simply output "No".

1 2 0 0
3 4 0 0
0 0 4 3
0 0 1 2
1 3 0 0
4 2 0 0
0 0 4 1
0 0 3 2
Yes
1 2 3 4 
3 4 2 1 
2 1 4 3 
4 3 1 2
No