Sea Battle
After a successful raid in Li-El Bay, the Airfooted Bison and Swift Monkey tribes captured a squadron of the latest Sudislav military ships. However, the ship crews managed to escape with the uranium rods, leaving the ships immobile.
The ships are divided into two equal groups, each stationed in a separate bay. Each bay is a square, one kilometer on each side, divided into 100 identical squares, each measuring 100×100 meters. The ships belong to the following classes:
Battleships: 100 meters wide and 400 meters long;
Dreadnoughts: 100×300 meters;
Destroyers: 100×200 meters;
Ekranoplanes: 100×100 meters.
With the ships' arsenals fully stocked, the chiefs decided to hold combat exercises between the groups the next morning, taking turns firing in an arc into the enemy bay. The Cunning Monkey dispatched a squad of warriors in canoes to scout the enemy ships' positions in the bay.
The scouts discovered that each of the hundred squares in the bay was either completely empty or entirely occupied by a ship or part of it. No two squares containing ships touched each other, either by side or corner. The scouts recorded what was in each square, but their map got wet, and some markings were lost. Embarrassed to return with incomplete information, they ask you to determine the maximum possible length of a ship that is not fully depicted on the map and could be in the bay.
Input
The input file provides the Monkey's map as a 10×10 matrix. Each element of the matrix represents a square of the bay and contains one of the following symbols:
' ' (space) - if the information about this square was lost;
'.' - if this square was explored and no ship was found;
'*' - if this square was explored and part of a ship was found.
It is guaranteed that at least one ship is not fully marked.
Output
On the first line, output an integer representing the maximum possible length in meters of the ship not fully discovered in the enemy's training bay. In the subsequent lines, output the Monkey's map in the same format as the input file, with the possible placement of the ship of the specified length added using '*' symbols. If there are multiple solutions, you may output any one of them.