John recently found an interesting flash game on BBS. The game is mainly about making the best of the present waterdrops and use as little waterdrops as possible to eliminate all the
waterdrops on board.Now let’s briefly introduce the operations: The game board is a 6*6 square. At the beginning, there are waterdrops in some squares (in different sizes), gamers can obtain a larger waterdrop by adding little waterdrops to the square. When the number of little waterdrops in the square meets 4, the big waterdrop in the square breaks, producing 4 little waterdrops, in whatever circumstances, the broken waterdrop can only produce 4 little waterdrops, which then fly up, down left, right, four directions. When a little whatdrop meets a square that contains a waterdrop, it will be absorbed, and the one in the square will become larger, just the same as when you manually add one to the square. When multiple waterdrops arrive at (a square that contains a waterdrop) simultaneously, they will be absorbed by the square. If the waterdrop touch the edge of board, it disappears. Gamers hope to use the least waterdrops to eliminate the waterdrops on board, so they can make through more levels. For further details, please visit “flashempire”. John and other byr players are obsessed with the game, but he is just not good at it. It’s mainly because after he comes up with an order to add the waterdrop, he can’t imagine the layout. Now John needs your help. So you will be given a game board and how the waterdrops are distributed, and John will tell you how he is going to add the waterdrop, he hopes that you can tell him if it can make it through the level, if not, tell him what the board will be like at the end. We use a n*m square to represent the game board, and L to represent the up limit of the number of waterdrops each square can contain, the number of waterdrops in each square exceeds L, the drop breaks. And the broken water drop produces 4 little waterdrops that will fly in four directions in the same speed.