A mine-sweeper map can be expressed as an $r\times c$ grid, and each cell of the grid is either mine cell or non-mine cell. A mine cell has no number on it, while a non-mine cell has a number, the number of mine cells that share at least one common point with the cell, on it. Following is a $16\times 30$ mine-sweeper map, where flag cells denotes mine cells while blank cells denotes non-mine cells with number 0 on them.
Given an integer $S$, construct a mine-sweeper map of $r, c$ both not exceeding 25, whose sum of numbers on non-mine cells exactly equals $S$. If multiple solutions exist, print any one of them. If no solution, print "-1" in one line.