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

namespace Cenzura
{
    class Program
    {
        static void Zameni(ref char s, ref char s1)
        {
            char p = s;
            s = s1;
            s1 = p;
        }
        static string Formiraj(string t, string s, int n, int m,out int broj)
        {
            char[] a = t.ToCharArray();
            char[] b = s.ToCharArray();
            char[] p = new char[n];
            int br = 0;
            p[0] = a[0];
            broj = 0;
            char orig;
            int poz = 0;
            char z = '*';
            if (t!=s)
            {
                for (int i = 1; i < n-1; i++)
                {
                    if (a[i-1]!=a[i] && a[i]!=a[i+1])
                    {
                        broj++;
                        orig = a[i];
                        poz = i;
                        Zameni(ref a[poz], ref z);
                    }


                }
            }
            else
            {
                Zameni(ref a[2], ref z);
                broj++;
            }
            return new string(a);
        }

        static void Main(string[] args)
        {
            string t = Console.ReadLine();
            int n = t.Length;
            if (n <= 1 || n >= 200000)
            {
                t = Console.ReadLine();
                n = t.Length;
            }
            string s = Console.ReadLine();
            int m = t.Length;
            if (m <= 1 || m >= 10)
            {
                s = Console.ReadLine();
                m = t.Length;
            }

            int br;
            string novi = Formiraj(t, s, n, m, out br);
            Console.WriteLine(br);
            Console.WriteLine(novi);
            Console.ReadKey();
        }
    }
}