/*     electric love #jdragon
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠤⠖⠚⢉⣩⣭⡭⠛⠓⠲⠦⣄⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⡴⠋⠁⠀⠀⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠳⢦⡀⠀⠀⠀⠀
⠀⠀⠀⠀⢀⡴⠃⢀⡴⢳⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⣆⠀⠀⠀
⠀⠀⠀⠀⡾⠁⣠⠋⠀⠈⢧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢧⠀⠀
⠀⠀⠀⣸⠁⢰⠃⠀⠀⠀⠈⢣⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣇⠀
⠀⠀⠀⡇⠀⡾⡀⠀⠀⠀⠀⣀⣹⣆⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⠀
⠀⠀⢸⠃⢀⣇⡈⠀⠀⠀⠀⠀⠀⢀⡑⢄⡀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇
⠀⠀⢸⠀⢻⡟⡻⢶⡆⠀⠀⠀⠀⡼⠟⡳⢿⣦⡑⢄⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇
⠀⠀⣸⠀⢸⠃⡇⢀⠇⠀⠀⠀⠀⠀⡼⠀⠀⠈⣿⡗⠂⠀⠀⠀⠀⠀⠀⠀⢸⠁
⠀⠀⡏⠀⣼⠀⢳⠊⠀⠀⠀⠀⠀⠀⠱⣀⣀⠔⣸⠁⠀⠀⠀⠀⠀⠀⠀⢠⡟⠀
⠀⠀⡇⢀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⠃⠀
⠀⢸⠃⠘⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠁⠀⠀⢀⠀⠀⠀⠀⠀⣾⠀⠀
⠀⣸⠀⠀⠹⡄⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⡞⠀⠀⠀⠸⠀⠀⠀⠀⠀⡇⠀⠀
⠀⡏⠀⠀⠀⠙⣆⠀⠀⠀⠀⠀⠀⠀⢀⣠⢶⡇⠀⠀⢰⡀⠀⠀⠀⠀⠀⡇⠀⠀
⢰⠇⡄⠀⠀⠀⡿⢣⣀⣀⣀⡤⠴⡞⠉⠀⢸⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⣧⠀⠀
⣸⠀⡇⠀⠀⠀⠀⠀⠀⠉⠀⠀⠀⢹⠀⠀⢸⠀⠀⢀⣿⠇⠀⠀⠀⠁⠀⢸⠀⠀
⣿⠀⡇⠀⠀⠀⠀⠀⢀⡤⠤⠶⠶⠾⠤⠄⢸⠀⡀⠸⣿⣀⠀⠀⠀⠀⠀⠈⣇⠀
⡇⠀⡇⠀⠀⡀⠀⡴⠋⠀⠀⠀⠀⠀⠀⠀⠸⡌⣵⡀⢳⡇⠀⠀⠀⠀⠀⠀⢹⡀
⡇⠀⠇⠀⠀⡇⡸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠮⢧⣀⣻⢂⠀⠀⠀⠀⠀⠀⢧
⣇⠀⢠⠀⠀⢳⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡎⣆⠀⠀⠀⠀⠀⠘
⢻⠀⠈⠰⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠰⠘⢮⣧⡀⠀⠀⠀⠀
⠸⡆⠀⠀⠇⣾⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠆⠀⠀⠀⠀⠀⠀⠀⠙⠳⣄⡀⢢⡀
 oregairu */ 
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define fl i,a,b for(int i=a;i<b;i++)
#define co cout<<
#define ci cin>>
#define rep(i,x,n) for(long long i = x; i < n; i++) 
#define rev(i,n,x) for(int i = n; i >= x; i--)
#define ff            first
#define ss            second
#define vecll vector<long long>
#define pii pair<long long ,long long >
#define pip pair<int,pair<int,int>>
#define ppp pair<pair<int,int>,pair<int,int>>
#define inarr(arr,x,n)  for(ll i=x ;i<n;i++) cin >> arr[i];
#define carr(v,x,n)  for(ll i=x ;i<n;i++) cout << v[i]-v[i-1]<<" ";
#define mpp make_pair
#define pb               push_back
#define ppb               pop_back
#define all(x)          (x).begin(),(x).end()
#define sz(x)           (x).size()
#define henshin           cout<<endl;
#define DEBUG(x) cout << (x) << '\n';
#define int long long 
const ll oo = 1e18;
inline void yn(int x) { if(!x)cout << "NO\n";  else if(x)cout << "YES\n";return; }

const ll N=1e6+5,M=1e9+7,mod=998244353;
  const int MAXA = 1e5+7; 
      //vector<int> primes;
   // int mind[MAXA + 1];
// map<int,int> xprime;
 
void solve() {    
ll a,b; ci a>>b;
string s;ci s;ll n= s.length();
stack<int> q;

if(n%2==0 && (a%2!=0 || b%2!=0) ){co -1<<endl;return;}
if(n%2==1 && ((a+b)%2==0) ){co -1<<endl;return;}

int x=0;
rep(i,0,n/2){
     

    if(s[i]!='?' && s[n-1-i]!='?'){
    if(s[i]!=s[n-1-i]){co -1<<endl;return;}

    if(s[i]=='1')b-=2; else a-=2;
    continue;
    }

  if((s[i]!='?' && s[n-1-i]=='?') ){
          s[n-1-i]=s[i] ; 
         if(s[i]=='1')b-=2; else a-=2;
    }
    else if((s[i]=='?' && s[n-1-i]!='?') ){
         s[i]=s[n-1-i] ; 
         if(s[i]=='1')b-=2; else a-=2;
    }  
    else if(s[i]=='?' && s[n-1-i]=='?')x++;
}
if(a<0 || b<0 ){co -1<<endl;return;}



if(n%2){ 
    if(b%2==1){
        if(s[n/2]=='1')b--;
        else if(s[n/2]=='?'){s[n/2]='1';b--;}
        else {co -1<<endl;return;}
    }
    if(a%2==1){
        if(s[n/2]=='0')a--;
        else if(s[n/2]=='?'){s[n/2]='0';a--;}
        else {co -1<<endl;return;}
    }
}
if (a%2!=0 || b%2!=0){co -1<<endl;return;}
 //co a<<b<<x<<endl;
 
if(a>=0 && b>=0 && (a+b)==2*x){ 
rep(i,0,n){
    if(s[i]!='?')co s[i];
    else {
        if(a>0){co 0;a-=2;s[n-1-i]='0';}
        else if (b>0){co 1;b-=2;s[n-1-i]='1';}
    }
}
 }
else co -1;
henshin
}





 
signed main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    int tt = clock();
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);
    
    int tc=1;     ci tc;
 /* 
  for (int i = 2; i <= MAXA; ++i) {
        if (mind[i] == 0) {
            primes.emplace_back(i);
            mind[i] = i;
        }
        for (auto &x : primes) {
            if (x > mind[i] || x * i > MAXA) break;
            mind[x * i] = x;
        }
    }
 */
 
    while(tc--) { 
 solve(); 
      
#ifdef _DEBUG
        cerr << "TIME = " << clock() - tt << endl;
        tt = clock();
#endif
    }
    return 0;
}



