#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int T;
string s,t;
void solve(){
int ps=0,pt=0;
int n=s.size(),m=t.size();
bool f=false;
while(ps<n){
if(s[ps]==t[pt]||s[ps]=='?'){
s[ps]=t[pt];
pt++;
ps++;
}else{
ps++;
}
if(pt==m){
f=true;
break;
}
}
if(f){
cout<<"YES"<<endl;
for(int i=0;i<s.size();i++){
if(s[i]=='?'){
cout<<'a';
}else{
cout<<s[i];
}
}
cout<<endl;
}else{
cout<<"NO";
cout<<endl;
}
return;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin>>T;
while(T--){
cin>>s>>t;
solve();
}
return 0;
}