#include <bits/stdc++.h>
# define endl            '\n'
# define clr(x,a)        memset(x,a,sizeof(x))
# define vi              vector<int>
# define all(a)          a.begin(), a.end()
# define deb(x)          cout<<#x<<"=="<<x<<endl;
# define pb              push_back
# define sc              scanf
# define pr              printf
# define tc              int testcase; cin>>testcase; while(testcase--)
# define rev(s)          reverse(s.begin(),s.end())
# define linija          cout<<"___________\n";
using namespace std;
const int mxN=10005;
string s, t;

int main(){
   cin>>s>>t;
   int aovi=0;
   for(char c: s) if(c=='a') aovi++;
   for(int i=0; i<s.size(); i++){
      if(s[i]=='a'){
         s[i]='*';
         aovi--;
         if(aovi==t.size()-1){
            cout<<s<<endl;
            return 0;
         }
      }
   }

   return 0;
}