using System;



    class Program
    {







        static void Main(string[] args)
        {
            
                int n, m;
                string[] mat = Console.ReadLine().Split();
                n = int.Parse(mat[0]);
                m = int.Parse(mat[1]);
                mat = new string[n];
                bool pr = true;
                for (int i = 0; i < n; i++)
                {
                    mat[i] = Console.ReadLine();
                    for (int j = 0; j < m; j++)
                        if (mat[i][j].ToString() != ".")
                        {
                            pr = false;
                        }
                }
                if (pr )
                {
                    bool[,] mat2 = new bool[n, m];
                    for (int i = 0; i < n; i++)
                    {
                        for (int j = 0; j < m; j++)
                        {
                            if (mat2[i, j])
                                Console.Write(".");
                            else
                            {
                                Console.Write("C");

                                for (int k = 0; k < n; k++)
                                    mat2[k, j] = true;
                                for (int k = 0; k < m; k++)
                                    mat2[i, k] = true;
                            }
                        }
                        Console.WriteLine();
                    }
                   
                }
            
        }
    }