WA了唯一的测试点,悲催
#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
int l[2];
l[0]=s.size();
l[1]=t.size();
if(l[0]<l[1]){
cout<<"UNRESTORABLE";
return 0;
}
bool b=0;
int r=-1;
for(int i=0;i<l[0]-l[1]+1;i++){
int x=0;
for(int j=i;j<i+l[1];j++){
if(s[j]!='?'&&s[j]!=t[x]){
break;
}
if(j==i+l[1]){
r=i;
}
x++;
}
}
if(r==-1){
cout<<"UNRESTORABLE";
return 0;
}
int x=0;
for(int i=r;i<l[0];i++){
if(s[i]=='?'){
s[i]=t[x];
}
x++;
}
for(int i=0;i<l[0];i++){
if(s[i]=='?'){
s[i]='a';
}
cout<<s[i];
}
return 0;
}