#include <bits/stdc++.h>
using namespace std;

#define long int64_t
#define endl '\n'

#ifdef OFFLINE
	#define logan(...) logg(#__VA_ARGS__, __VA_ARGS__)
	template<class Arg>
	void logg(const char* name, Arg&& arg){ cerr << name << ": " << arg << '\n'; }
	template<class Arg, class ... Args>
	void logg(const char* name, Arg&& arg, Args&& ... args){
		const char* next = strchr(name+1, ',');
		cerr.write(name, next-name) << ": " << arg << ",";
		logg(next+1, args...);
	}
	#define timeme 1.0*clock()/CLOCKS_PER_SEC
#else
	#define logan(...) {}
	#define timeme {}
#endif

char res[11][11];

void done(int n, int m){
	for(int i = 0; i < n; ++i){
		for(int j = 0; j < m; ++j)
			cout << res[i][j];
		cout << endl;
	}
	exit(0);
}

void fill_blank(int n, int m){
	for(int i = 0; i < min(n, m); ++i) res[i][i] = 'C';
	done(n, m);
}

/* 10p je 10p
 */
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);

	int n, m; cin >> n >> m;
	int nb = 0;
	for(int i = 0; i < n; ++i){
		string t; cin >> t;
		for(int j = 0; j < m; ++j){
			res[i][j] = t[j];
			if(t[j] != '.') ++nb;
		}
	}
	if(!nb) fill_blank(n, m);


}