#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    string rec, cenzura;

    cin >> rec;
    cin >> cenzura;

    int duzina = rec.length();
    int duz = cenzura.length();

    int axz;
    char asd[duzina+1];
    char asb[duz+1];

    int mini = 100;
    int loli = 10000;
    char asx;
    int m_pos;

    strcpy(asd, rec.c_str());
    strcpy(asb, cenzura.c_str());

    for(int i = 0; i<duzina; i++)
    {
        if(asd[i] == asb[i])
        {
            continue;
        }
        else
        {
            axz = count(rec.begin(), rec.end(), asd[i]);
            if(axz < loli)
            {
                loli = axz;
                m_pos = i;
            }

        }
    }
    cout << loli << endl;
    for(int i = 0; i<duzina; i++)
    {
        if(asd[i] == asd[m_pos])
        {
            cout << "*";
        }
        else
        {
            cout << asd[i];
        }
    }
    cout << endl;
    return 0;
}