#include<bits/stdc++.h>
#define deb(x) cout << #x << ':' << (x) << endl;
#define ll long long
using namespace std;
const int maxn = 2e5 + 5;

ll read()
{
    char ch=getchar();
    ll x=0,f=1;
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
    return x*f;
}

void solve()
{
    ll a = read(), b = read();
    string s;
    cin >> s;
    ll n = a + b;
    if (a % 2 == 1 && b % 2 == 1) {puts("-1"); return;}

    if (a % 2 == 1)
    {
        if (s[(n-1)/2] == '1') {puts("-1"); return;}
        s[(n-1)/2] = '0';
        a--;
    }
    if (b % 2 == 1) {
        if (s[(n-1)/2] == '0') {puts("-1"); return;}
        s[(n-1)/2] = '1';
        b--;
    }

    for (int i = 0; i < n; i++)
    {
        if (n % 2 == 1 && i == (n-1)/2) continue;
        if (s[i] == '0')
        {
            if (s[n-1-i] == '1') {puts("-1"); return;}
            s[n-1-i] = '0';
        }
        if (s[i] == '1')
        {
            if (s[n-1-i] == '0') {puts("-1"); return;}
            s[n-1-i] = '1';
        }
    }

    for (int i = 0; i < n; i++)
    {
        if (n % 2 == 1 && i == (n - 1) / 2) continue;
        if (s[i] == '0') a--;
        if (s[i] == '1') b--;
    }

    // deb(a)
    // deb(b)
    // deb(s)
    for (int i = 0; i < n; i++)
    {
        if (s[i] == '?')
        {
            if (a != 0)
            {
                s[i] = '0';
                s[n-1-i] = '0';
                a -= 2;
            }
            else 
            {
                s[i] = '1';
                s[n-1-i] = '1';
                b -= 2;
            }
        }
    }
    if (a < 0 || b < 0) {puts("-1"); return;}
    cout << s << endl;
}

int main()
{
    int t;cin>>t;
    while(t--){
        solve();
    }
}