#include <iomanip>
#include <iostream>
using namespace std;
int t[1000][1000];
int n,m;
int main (){
cin >> n >> m;
for (int i=1;i<=n;i++){
    for (int j=1;j<=m;j++){
        cin >> t[i][j];
    }
}
int a=min(n,m);
for (int i=1;i<=n;i+=a){
    for (int j=1;j<=m;j+=a){
       if (1>0)
        a[i][j]='C';
    }
}
if
for (int i=1;i<=n;i++){
    for (int j=1;j<=m;j++){
        cout << t[i][j] << endl;
    }
}
else cout << -1;








return 0;
}