#include <iostream>

using namespace std;

int main()
{
    bool ind;
    int br = 0, x;
    string t,s;
    cin >> t >> s;
    for (int i = 0; i < t.size(); i++){
        if(t[i] == 'a')br++;
    }
    x = s.size();
    if(br >= x){
        for (int i = 0; i < t.size(); i++){
            if(t[i] == 'a'){
                t[i] = '*';
                x += 1;
            }
            if(br - x == -1)
                break;
        }
        cout << x - s.size() << endl;
        cout << t << endl;
    }
    else
        cout << 0;



    return 0;
}