437. Hexodoku
Time limit per test: 4 second(s)
Memory limit: 262144 kilobytes
input: standard
output: standard



Sudoku is an amazing game. Many people have fun solving it. They say that a legendary programmer had spent just 7 minutes on writing a program that solves standard sudoku. That's über cool, don't you think? And now he has solved another problem. Can you do the same?

Consider a non-standard hexagonal Sudoku board with 31 cells. The cells are
numbered from 1 to 31 and laid out as the hexagon below; cells marked with "*"
are the special marked cells described later:

                 1     2
           3     4     5*    6     7
        8     9*   10    11    12*   13
          14    15    16*   17    18
       19    20*   21    22    23*   24
          25    26    27*   28    29
                30    31

The cells are numbered from 1 to 31.

According to the rules, numbers (from 1 to K) can be placed in the cells with the condition that all numbers in the same row (rows are located in three directions) must be different.

The three directions are: the horizontal rows, the "/" diagonals (lines going
from lower-left to upper-right), and the "\" diagonals (lines going from
upper-left to lower-right). Every one of the following 21 lines must contain
pairwise different numbers:

  Horizontal rows:
    1 2
    3 4 5 6 7
    8 9 10 11 12 13
    14 15 16 17 18
    19 20 21 22 23 24
    25 26 27 28 29
    30 31

  "/" diagonal rows:
    3 8
    1 4 9 14 19
    2 5 10 15 20 25
    6 11 16 21 26
    7 12 17 22 27 30
    13 18 23 28 31
    24 29

  "\" diagonal rows:
    7 13
    2 6 12 18 24
    1 5 11 17 23 29
    4 10 16 22 28
    3 9 15 21 27 31
    8 14 20 26 30
    19 25

Additionally, for each of the marked cells, the number in the marked cell and all numbers in adjacent cells must also differ from each other.

There are 7 marked cells: 5, 9, 12, 16, 20, 23 and 27. Each marked cell
together with its (up to six) neighbouring cells forms a group of 7 cells whose
numbers must all be distinct:

    marked 5  : { 1, 2, 4, 5, 6, 10, 11 }
    marked 9  : { 3, 4, 8, 9, 10, 14, 15 }
    marked 12 : { 6, 7, 11, 12, 13, 17, 18 }
    marked 16 : { 10, 11, 15, 16, 17, 21, 22 }
    marked 20 : { 14, 15, 19, 20, 21, 25, 26 }
    marked 23 : { 17, 18, 22, 23, 24, 28, 29 }
    marked 27 : { 21, 22, 26, 27, 28, 30, 31 }

(Each such group of 7 cells must use 7 different numbers, which is why K >= 7 is always required.)

Some numbers may already be placed in the cells according to the rules. You are to find N-th solution in lexicographical order, if it exists.

Let Ai be the number in the cell i in solution A, and Bi — the number in the cell i in solution B. Solution A is lexicographically smaller than solution B, if such j exists that for each i where i < j: Ai = Bi and Aj < Bj.

Input
First line of input contains two integers K and N.

7 ≤ K ≤ 31

1 ≤ N ≤ 10^18

Second line contains 31 integer numbers: Ai (1 ≤ i ≤ 31) is the number standing in the cell i.

1 ≤ Ai ≤ K, or 0, if there is no number in this cell.


Output
First line of output should contain an answer:

"Found" — if the solution has been found.
"No way" — if there is no N-th solution.


If the solution has been found, the second line of output should contain the N-th solution in the same format as in input.

Example(s)
sample input
sample output
8 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Found
1 2 1 3 4 5 2 2 4 6 7 1 3 7 5 1 8 6 2 1 3 4 5 7 8 6 7 2 3 5 8

sample input
sample output
7 100000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
No way
