uua___ @ 2024-09-04 16:48:01
#include <bits/stdc++.h>
using namespace std;
int sum;
int main()
{
string a,b;
char x;
x='a';
int n,m;cin>>n>>m;
cin>>a>>b;
for(int i=0;i<=n;i++)
{
if(b[i]=='#') sum++;
}
int k=sum/26;
for(int i=0;i<=n;i++)
{
if(a[i]=='#')
{
if(k>=1)
{
a[i]='a';
k--;
continue;
}
else
{
a[i]=x;
x=x+1;
}
}
}
for(int i=0;i<=n;i++) cout<<a[i];
return 0;
}