#include<iostream>

using namespace std;
int N,M;
char a[15][15];
int T=true;
int main(){
cin>>N>>M;
    for(int i=1;i<=N;i++){
        for(int j=1;j<=M;j++){
            cin>>a[i][j];
            if(a[i][j]!='.')T=false;
        }
    }
    if(T==true){
        int i=1;
        int j=1;
        while(i<=N and j<=M){
            a[i][j]='C';
            i++;
            j++;
        }

    for(int i=1;i<=N;i++){
        for(int j=1;j<=M;j++){
            cout<<a[i][j]<<" ";
        }
        cout<<endl;
    }
    }
if(T==false)cout<<-1<<endl;


return 0;
}