#include <bits/stdc++.h>

using namespace std;

#define int long long
#define nn "\n"
#define pi pair<int, int>
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define eb emplace_back
#define pb push_back
#define TASK " "

#define ms(a, x) memset(a, x, sizeof(a))
#define all(a) a.begin(), a.end()
#define All(a, n) a + 1, a + 1 + n

#define LOG 19

const int INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 5;
int MOD = 998244353;
int bit[200000];

struct node{
    int kc, u, hk;
    bool operator<(const node& other) const {
        return kc > other.kc;
    }
};

struct edge{
    int u, v, w;
    friend bool operator < (edge a, edge b){
        return a.w < b.w;
    }
};

void nhap(){

}

void solve(){
    int n;
    cin >> n;
    vector<pi> a(n + 1);
    for(int i = 1; i <= n; i++){
        cin >> a[i].fi;
        a[i].se = i;
    }
    sort(a.begin() + 1, a.end());
    int cnt0 = 0;
    for(int i = 1; i <= n; i++){
        if(a[i].fi == 0) cnt0++;
    }
    if(cnt0 == 1){
        cout << "NO" << nn;
        return;
    }
    cout << "YES" << nn;
    string ans(n, 'A');
    vector<int> mex(3, 0);
    for(int i = 1; i <= n; i++){
        int id = 0;

        if(mex[1] < mex[id]){
            id = 1;
        }
        if(mex[2] < mex[id]){
            id = 2;
        }
        if(id == 0){
            ans[a[i].se - 1] = 'A';
        }
        else if(id == 1){
            ans[a[i].se - 1] = 'B';
        }
        else{
            ans[a[i].se - 1] = 'C';
        }
        if(a[i].fi == mex[id]){
            mex[id]++;
        }
    }
    cout << ans << nn;
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t;
    cin >> t;

    while(t--){
        solve();
    }

    return 0;
}