Domino
A standard set of dominoes consists of 28 tiles, each featuring two numbers ranging from 0 (blank) to 6. We will represent these 28 tiles using the following encoding:
This complete set of dominoes can be arranged on a board measuring 7×8. Your task is to identify the codes of the domino tiles that cover the corresponding cells based on the values provided on the board. Each tile must be used exactly once.
Input
The input consists of 7 rows, representing the board as a 7×8 matrix filled with integers from 0 to 6.
Output
On the first line of the output, print "+" if a valid arrangement of the given values can be achieved, and "-" if it cannot. If a valid arrangement is possible, also provide one of the potential mappings of domino tile codes to the board cells.