using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace rokada
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Convert.ToString(Console.ReadLine());
            string[] a1 = a.Split(' ');
            int n = Convert.ToInt32(a1[0]);
            int m = Convert.ToInt32(a1[1]);
            string[,] t = new string[n, m];
            int br = 0;
            for(int i = 0; i < n; i++)
            {
                a = Convert.ToString(Console.ReadLine());
                string[] a2 = a.Split(' ');
                for(int j = 0; j < m; j++)
                {
                    t[i, j] = a2[j];
                    if (t[i, j] == ".")
                        br++;
                }
            }
            if (br == m * n)
            {
                int p = 0, q = 0;
                while (p < n && q < m)
                {
                    t[p, q] = "C";
                    p++;
                    q++;
                }
                for (int i = 0; i < n; i++)
                {
                    for (int j = 0; j < m; j++)
                        Console.Write("{0}", t[i, j]);
                    Console.WriteLine();
                }
            }
            else
                Console.WriteLine("-1");
            Console.ReadLine();
        }
    }
}