Domino#3668

Domino

1 second
256 megabytes
Easy

A standard set of dominoes consists of tiles, each featuring two numbers ranging from (blank) to . We will represent these tiles using the following encoding:

This complete set of dominoes can be arranged on a board measuring 7 \times 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 rows, representing the board as a 7 \times 8 matrix filled with integers from to .

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.

Examples

Example 1

Loading
Loading