Program Rokada;
var n,m,i,j,p:integer;a,a1:array [1..10,1..10] of string;
begin
readln(n,m);
p:=0;
for i:=1 to n do
for j:=1 to m do
   begin
   read(a[i,j]);
   if a[i,j]='.' then p:=p+1;
   a1[i,j]:=a[i,j];
   end;
if p=n*m then
   begin
   i:=1;
   j:=1;
   while (i<=n) and (j<=m) do
     begin
     a1[i,j]:='C';
     i:=i+1;
     j:=j+1;
     end;
   end;
for i:=1 to n do
 begin
 for j:=1 to m do
 write(a1[i,j]);
 writeln;
 end;
end.