#include<bits/stdc++.h>
using namespace std;
inline int read(){
int res=0,f=0;
char ch=getchar();
while(ch<'0'||ch>'9'){
f|=(ch=='-');
ch=getchar();
}
while(ch>='0'&&ch<='9'){
res=(res<<1)+(res<<3)+(ch^'0');
ch=getchar();
}
return f?-res:res;
}
void write(int x){
if(x<0){
putchar('-');
x=-x;
}
if(x>9)
write(x/10);
putchar(x%10+'0');
}
int T,n,a,e;
string s;
inline void solve(){
int cnt=0,c=0;
for(int i=0;i<(n<<1);++i)
if(s[i]=='A')
++cnt;
else
++c;
if(abs(cnt-a)>e){
puts("-1");
return;
}
if((e-abs(cnt-a))%2){
puts("-1");
return;
}
int B=(e-abs(cnt-a))/2,A=a-B;
int aa=0,bb=0;
if(A>cnt||B>c){
puts("-1");
return;
}
for(int i=0;i<(n<<1);++i)
if(s[i]=='A'){
if(aa<A)
putchar('A'),++aa;
else
putchar('B');
} else{
if(bb<B)
putchar('A'),++bb;
else
putchar('B');
}
puts("");
}
inline void input(){
cin>>T;
while(T--){
cin>>n>>a>>e>>s;
solve();
}
}
signed main(){
input();
return 0;
}