#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    char tabla[10][10];
    int n,m,a=0;
    cin >> n >> m;
    for (int i=0;i<n;i++)
    for (int j=0;j<m;j++){
        cin >> tabla[i][j];
        if (tabla[i][j]!='.')
            a=1;
    }
    if (a)
    cout << -1 << endl; else{
        for (int i=0;i<min(m,n);i++)
            tabla[i][i]='C';
        for (int i=0;i<n;i++){
        for (int j=0;j<m;j++){
        cout << tabla[i][j];}
        cout << endl;
    }
    }
    return 0;
}